@aws-amplify/ui-react-native 1.2.28 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Authenticator/Authenticator.d.ts +83 -12
- package/dist/Authenticator/Authenticator.js +19 -16
- package/dist/Authenticator/Defaults/{ResetPassword/ResetPassword.d.ts → ForgotPassword/ForgotPassword.d.ts} +2 -2
- package/dist/Authenticator/Defaults/{ResetPassword/ResetPassword.js → ForgotPassword/ForgotPassword.js} +1 -1
- package/dist/Authenticator/Defaults/ForgotPassword/index.d.ts +1 -0
- package/dist/Authenticator/Defaults/ForgotPassword/index.js +1 -0
- package/dist/Authenticator/Defaults/{SetupTOTP/SetupTOTP.d.ts → SetupTotp/SetupTotp.d.ts} +4 -4
- package/dist/Authenticator/Defaults/{SetupTOTP/SetupTOTP.js → SetupTotp/SetupTotp.js} +10 -10
- package/dist/Authenticator/Defaults/SetupTotp/index.d.ts +1 -0
- package/dist/Authenticator/Defaults/SetupTotp/index.js +1 -0
- package/dist/Authenticator/Defaults/SetupTotp/styles.d.ts +5 -0
- package/dist/Authenticator/Defaults/SignIn/SignIn.d.ts +1 -1
- package/dist/Authenticator/Defaults/SignIn/SignIn.js +6 -5
- package/dist/Authenticator/Defaults/SignUp/SignUp.d.ts +1 -1
- package/dist/Authenticator/Defaults/SignUp/SignUp.js +4 -3
- package/dist/Authenticator/Defaults/index.d.ts +2 -2
- package/dist/Authenticator/Defaults/index.js +2 -2
- package/dist/Authenticator/Defaults/types.d.ts +11 -11
- package/dist/Authenticator/common/FederatedProviderButton/FederatedProviderButton.js +2 -4
- package/dist/Authenticator/common/FederatedProviderButton/types.d.ts +3 -1
- package/dist/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.d.ts +1 -1
- package/dist/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.js +24 -11
- package/dist/Authenticator/common/FederatedProviderButtons/styles.d.ts +2 -1
- package/dist/Authenticator/common/FederatedProviderButtons/styles.js +14 -4
- package/dist/Authenticator/common/FederatedProviderButtons/types.d.ts +5 -3
- package/dist/Authenticator/hooks/useFieldValues/useFieldValues.js +1 -1
- package/dist/Authenticator/hooks/useFieldValues/utils.js +1 -1
- package/dist/Authenticator/types.d.ts +1 -1
- package/dist/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +2 -2
- package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.d.ts +2 -2
- package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.js +2 -2
- package/dist/InAppMessaging/hooks/useMessageImage/utils.d.ts +2 -2
- package/dist/InAppMessaging/hooks/useMessageImage/utils.js +2 -2
- package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +2 -2
- package/dist/InAppMessaging/hooks/useMessageProps/utils.d.ts +2 -2
- package/dist/InAppMessaging/index.d.ts +1 -1
- package/dist/InAppMessaging/index.js +1 -0
- package/dist/assets/icons/icons.ts +3 -0
- package/dist/primitives/Button/styles.js +4 -2
- package/dist/primitives/Carousel/Carousel.js +1 -11
- package/dist/primitives/Divider/styles.js +4 -3
- package/dist/primitives/ErrorMessage/ErrorMessage.d.ts +1 -1
- package/dist/primitives/ErrorMessage/ErrorMessage.js +2 -2
- package/dist/primitives/Icon/Icon.d.ts +1 -1
- package/dist/primitives/Icon/Icon.js +2 -1
- package/dist/primitives/Icon/styles.js +1 -1
- package/dist/primitives/Radio/styles.js +1 -1
- package/dist/primitives/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/RadioGroup/RadioGroup.js +2 -2
- package/dist/primitives/Tabs/Tabs.d.ts +1 -1
- package/dist/primitives/Tabs/Tabs.js +2 -2
- package/dist/primitives/Tabs/styles.js +3 -3
- package/dist/utils/platform.d.ts +1 -2
- package/lib/Authenticator/Authenticator.js +17 -14
- package/lib/Authenticator/Defaults/{ResetPassword/ResetPassword.js → ForgotPassword/ForgotPassword.js} +1 -1
- package/lib/Authenticator/Defaults/ForgotPassword/index.js +8 -0
- package/lib/Authenticator/Defaults/{SetupTOTP/SetupTOTP.js → SetupTotp/SetupTotp.js} +10 -10
- package/lib/Authenticator/Defaults/{SetupTOTP → SetupTotp}/index.js +3 -3
- package/lib/Authenticator/Defaults/SignIn/SignIn.js +5 -4
- package/lib/Authenticator/Defaults/SignUp/SignUp.js +3 -2
- package/lib/Authenticator/Defaults/index.js +5 -5
- package/lib/Authenticator/common/FederatedProviderButton/FederatedProviderButton.js +2 -4
- package/lib/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.js +22 -9
- package/lib/Authenticator/common/FederatedProviderButtons/styles.js +16 -5
- package/lib/Authenticator/hooks/useFieldValues/useFieldValues.js +8 -8
- package/lib/Authenticator/hooks/useFieldValues/utils.js +2 -2
- package/lib/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +2 -2
- package/lib/InAppMessaging/hooks/useMessageImage/types.js +1 -1
- package/lib/InAppMessaging/hooks/useMessageImage/useMessageImage.js +5 -5
- package/lib/InAppMessaging/hooks/useMessageImage/utils.js +2 -2
- package/lib/InAppMessaging/index.js +1 -0
- package/lib/assets/icons/icons.ts +3 -0
- package/lib/primitives/Button/styles.js +4 -2
- package/lib/primitives/Carousel/Carousel.js +1 -11
- package/lib/primitives/Divider/styles.js +4 -3
- package/lib/primitives/ErrorMessage/ErrorMessage.js +2 -2
- package/lib/primitives/Icon/Icon.js +2 -1
- package/lib/primitives/Icon/styles.js +2 -2
- package/lib/primitives/Radio/styles.js +1 -1
- package/lib/primitives/RadioGroup/RadioGroup.js +2 -2
- package/lib/primitives/Tabs/Tabs.js +2 -2
- package/lib/primitives/Tabs/styles.js +3 -3
- package/package.json +16 -31
- package/src/Authenticator/Authenticator.tsx +20 -17
- package/src/Authenticator/Defaults/{ResetPassword/ResetPassword.tsx → ForgotPassword/ForgotPassword.tsx} +3 -3
- package/src/Authenticator/Defaults/ForgotPassword/index.ts +1 -0
- package/src/Authenticator/Defaults/{SetupTOTP/SetupTOTP.tsx → SetupTotp/SetupTotp.tsx} +13 -13
- package/src/Authenticator/Defaults/SetupTotp/index.ts +1 -0
- package/src/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.ts +2 -2
- package/src/Authenticator/Defaults/SignIn/SignIn.tsx +15 -3
- package/src/Authenticator/Defaults/SignUp/SignUp.tsx +12 -0
- package/src/Authenticator/Defaults/index.ts +2 -2
- package/src/Authenticator/Defaults/types.ts +13 -13
- package/src/Authenticator/common/FederatedProviderButton/FederatedProviderButton.tsx +2 -4
- package/src/Authenticator/common/FederatedProviderButton/types.ts +3 -1
- package/src/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.tsx +41 -13
- package/src/Authenticator/common/FederatedProviderButtons/styles.ts +19 -4
- package/src/Authenticator/common/FederatedProviderButtons/types.ts +9 -6
- package/src/Authenticator/hooks/useFieldValues/useFieldValues.ts +1 -1
- package/src/Authenticator/hooks/useFieldValues/utils.ts +1 -1
- package/src/Authenticator/types.ts +1 -4
- package/src/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.ts +2 -2
- package/src/InAppMessaging/hooks/useMessageImage/useMessageImage.ts +6 -6
- package/src/InAppMessaging/hooks/useMessageImage/utils.ts +5 -5
- package/src/InAppMessaging/hooks/useMessageProps/types.ts +3 -3
- package/src/InAppMessaging/hooks/useMessageProps/utils.ts +2 -2
- package/src/InAppMessaging/index.ts +9 -0
- package/src/assets/icons/icons.ts +3 -0
- package/src/hooks/useDeviceOrientation/useDeviceOrientation.ts +6 -1
- package/src/primitives/Button/styles.ts +4 -2
- package/src/primitives/Carousel/Carousel.tsx +1 -10
- package/src/primitives/Divider/styles.ts +4 -3
- package/src/primitives/ErrorMessage/ErrorMessage.tsx +4 -1
- package/src/primitives/Icon/Icon.tsx +2 -0
- package/src/primitives/Icon/styles.ts +1 -1
- package/src/primitives/Radio/styles.ts +1 -1
- package/src/primitives/RadioGroup/RadioGroup.tsx +6 -1
- package/src/primitives/Tabs/Tabs.tsx +4 -1
- package/src/primitives/Tabs/styles.ts +3 -3
- package/dist/Authenticator/Defaults/ResetPassword/index.d.ts +0 -1
- package/dist/Authenticator/Defaults/ResetPassword/index.js +0 -1
- package/dist/Authenticator/Defaults/SetupTOTP/index.d.ts +0 -1
- package/dist/Authenticator/Defaults/SetupTOTP/index.js +0 -1
- package/dist/Authenticator/Defaults/SetupTOTP/styles.d.ts +0 -5
- package/dist/Authenticator/common/FederatedProviderButton/styles.d.ts +0 -2
- package/dist/Authenticator/common/FederatedProviderButton/styles.js +0 -18
- package/lib/Authenticator/Defaults/ResetPassword/index.js +0 -8
- package/lib/Authenticator/common/FederatedProviderButton/styles.js +0 -21
- package/src/Authenticator/Defaults/ResetPassword/index.ts +0 -1
- package/src/Authenticator/Defaults/SetupTOTP/index.ts +0 -1
- package/src/Authenticator/common/FederatedProviderButton/styles.ts +0 -21
- /package/dist/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.js +0 -0
- /package/lib/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.js +0 -0
|
@@ -6,7 +6,13 @@ declare namespace Authenticator {
|
|
|
6
6
|
var Container: typeof DefaultContainer;
|
|
7
7
|
var Provider: typeof import("@aws-amplify/ui-react-core").AuthenticatorProvider;
|
|
8
8
|
var ConfirmResetPassword: {
|
|
9
|
-
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, resendCode, validationErrors, ...rest }: import("
|
|
9
|
+
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, resendCode, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
10
|
+
resendCode: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
11
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
12
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
13
|
+
} & {
|
|
14
|
+
style?: import("./Defaults/types").ConfirmResetPasswordStyle | undefined;
|
|
15
|
+
}): JSX.Element;
|
|
10
16
|
Footer: typeof import("./common").DefaultFooter;
|
|
11
17
|
FormFields: {
|
|
12
18
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -16,7 +22,14 @@ declare namespace Authenticator {
|
|
|
16
22
|
displayName: string;
|
|
17
23
|
};
|
|
18
24
|
var ConfirmSignIn: {
|
|
19
|
-
({ challengeName, fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }: import("
|
|
25
|
+
({ challengeName, fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
26
|
+
challengeName: import("@aws-amplify/ui").ChallengeName | undefined;
|
|
27
|
+
toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
28
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
29
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
30
|
+
} & {
|
|
31
|
+
style?: import("./Defaults/types").ConfirmSignInStyle | undefined;
|
|
32
|
+
}): JSX.Element;
|
|
20
33
|
Footer: typeof import("./common").DefaultFooter;
|
|
21
34
|
FormFields: {
|
|
22
35
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -26,7 +39,14 @@ declare namespace Authenticator {
|
|
|
26
39
|
displayName: string;
|
|
27
40
|
};
|
|
28
41
|
var ConfirmSignUp: {
|
|
29
|
-
({ codeDeliveryDetails, fields, handleBlur, handleChange, handleSubmit, isPending, resendCode, validationErrors, ...rest }: import("
|
|
42
|
+
({ codeDeliveryDetails, fields, handleBlur, handleChange, handleSubmit, isPending, resendCode, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
43
|
+
codeDeliveryDetails: import("@aws-amplify/ui").V5CodeDeliveryDetails;
|
|
44
|
+
resendCode: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
45
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
46
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
47
|
+
} & {
|
|
48
|
+
style?: import("./Defaults/types").ConfirmSignUpStyle | undefined;
|
|
49
|
+
}): JSX.Element;
|
|
30
50
|
FormFields: {
|
|
31
51
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
32
52
|
displayName: string;
|
|
@@ -36,7 +56,13 @@ declare namespace Authenticator {
|
|
|
36
56
|
displayName: string;
|
|
37
57
|
};
|
|
38
58
|
var ConfirmVerifyUser: {
|
|
39
|
-
({ fields, handleBlur, handleChange, handleSubmit, isPending, skipVerification, validationErrors, ...rest }: import("
|
|
59
|
+
({ fields, handleBlur, handleChange, handleSubmit, isPending, skipVerification, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
60
|
+
skipVerification: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
61
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
62
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
63
|
+
} & {
|
|
64
|
+
style?: import("./Defaults/types").ConfirmVerifyUserStyle | undefined;
|
|
65
|
+
}): JSX.Element;
|
|
40
66
|
Footer: typeof import("./common").DefaultFooter;
|
|
41
67
|
FormFields: {
|
|
42
68
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -46,7 +72,13 @@ declare namespace Authenticator {
|
|
|
46
72
|
displayName: string;
|
|
47
73
|
};
|
|
48
74
|
var ForceNewPassword: {
|
|
49
|
-
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, toSignIn, validationErrors, ...rest }: import("
|
|
75
|
+
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, toSignIn, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
76
|
+
toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
77
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
78
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
79
|
+
} & {
|
|
80
|
+
style?: import("./Defaults/types").ForceNewPasswordStyle | undefined;
|
|
81
|
+
}): JSX.Element;
|
|
50
82
|
Footer: typeof import("./common").DefaultFooter;
|
|
51
83
|
FormFields: {
|
|
52
84
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -55,8 +87,14 @@ declare namespace Authenticator {
|
|
|
55
87
|
Header: typeof import("./common").DefaultHeader;
|
|
56
88
|
displayName: string;
|
|
57
89
|
};
|
|
58
|
-
var
|
|
59
|
-
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }: import("
|
|
90
|
+
var ForgotPassword: {
|
|
91
|
+
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
92
|
+
toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
93
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
94
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
95
|
+
} & {
|
|
96
|
+
style?: import("./Defaults/types").ResetPasswordStyle | undefined;
|
|
97
|
+
}): JSX.Element;
|
|
60
98
|
Footer: typeof import("./common").DefaultFooter;
|
|
61
99
|
FormFields: {
|
|
62
100
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -65,8 +103,16 @@ declare namespace Authenticator {
|
|
|
65
103
|
Header: typeof import("./common").DefaultHeader;
|
|
66
104
|
displayName: string;
|
|
67
105
|
};
|
|
68
|
-
var
|
|
69
|
-
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }: import("
|
|
106
|
+
var SetupTotp: {
|
|
107
|
+
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
108
|
+
toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
109
|
+
totpSecretCode: string | null;
|
|
110
|
+
username: string;
|
|
111
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
112
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
113
|
+
} & {
|
|
114
|
+
style?: import("./Defaults/types").SetupTotpStyle | undefined;
|
|
115
|
+
}): JSX.Element;
|
|
70
116
|
Footer: typeof import("./common").DefaultFooter;
|
|
71
117
|
FormFields: {
|
|
72
118
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -76,7 +122,17 @@ declare namespace Authenticator {
|
|
|
76
122
|
displayName: string;
|
|
77
123
|
};
|
|
78
124
|
var SignIn: {
|
|
79
|
-
({ fields, handleBlur, handleChange, handleSubmit, hideSignUp,
|
|
125
|
+
({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, socialProviders, toFederatedSignIn, toForgotPassword, toSignUp, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
126
|
+
hideSignUp?: boolean | undefined;
|
|
127
|
+
socialProviders?: import("@aws-amplify/ui").SocialProvider[] | undefined;
|
|
128
|
+
toFederatedSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
129
|
+
toForgotPassword: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
130
|
+
toSignUp: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
131
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
132
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
133
|
+
} & {
|
|
134
|
+
style?: import("./Defaults/types").SignInStyle | undefined;
|
|
135
|
+
}): JSX.Element;
|
|
80
136
|
Footer: typeof import("./common").DefaultFooter;
|
|
81
137
|
FormFields: {
|
|
82
138
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -86,7 +142,16 @@ declare namespace Authenticator {
|
|
|
86
142
|
displayName: string;
|
|
87
143
|
};
|
|
88
144
|
var SignUp: {
|
|
89
|
-
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, toSignIn, validationErrors, ...rest }: import("
|
|
145
|
+
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, socialProviders, toFederatedSignIn, toSignIn, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
|
|
146
|
+
hideSignIn?: boolean | undefined;
|
|
147
|
+
socialProviders?: import("@aws-amplify/ui").SocialProvider[] | undefined;
|
|
148
|
+
toFederatedSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
149
|
+
toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
150
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
151
|
+
fields: import("./hooks").TextFieldOptionsType[];
|
|
152
|
+
} & {
|
|
153
|
+
style?: import("./Defaults/types").SignUpStyle | undefined;
|
|
154
|
+
}): JSX.Element;
|
|
90
155
|
Footer: typeof import("./common").DefaultFooter;
|
|
91
156
|
FormFields: {
|
|
92
157
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("./common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -96,7 +161,13 @@ declare namespace Authenticator {
|
|
|
96
161
|
displayName: string;
|
|
97
162
|
};
|
|
98
163
|
var VerifyUser: {
|
|
99
|
-
({ fields, handleBlur, handleChange, handleSubmit, skipVerification, validationErrors, ...rest }: import("
|
|
164
|
+
({ fields, handleBlur, handleChange, handleSubmit, skipVerification, validationErrors, ...rest }: import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").RadioFieldOptions> & {
|
|
165
|
+
skipVerification: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
|
|
166
|
+
} & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
|
|
167
|
+
fields: import("./hooks").RadioFieldOptions[];
|
|
168
|
+
} & {
|
|
169
|
+
style?: import("./Defaults/types").VerifyUserStyle | undefined;
|
|
170
|
+
}): JSX.Element;
|
|
100
171
|
Footer: typeof import("./common").DefaultFooter;
|
|
101
172
|
FormFields: {
|
|
102
173
|
({ fields, fieldContainerStyle, fieldLabelStyle, isPending, style, }: import("./common/DefaultFormFields/types").DefaultRadioFormFieldsProps): JSX.Element;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
3
|
-
import { AuthenticatorProvider as Provider, resolveAuthenticatorComponents, useAuthenticator, useAuthenticatorRoute, useAuthenticatorInitMachine, } from '@aws-amplify/ui-react-core';
|
|
4
|
-
import { configureComponent } from '@aws-amplify/ui';
|
|
3
|
+
import { AuthenticatorProvider as Provider, resolveAuthenticatorComponents, useAuthenticator, useAuthenticatorRoute, useAuthenticatorInitMachine, useSetUserAgent, } from '@aws-amplify/ui-react-core';
|
|
5
4
|
import { useDeprecationWarning } from '../hooks';
|
|
6
5
|
import { DefaultContainer, InnerContainer } from './common';
|
|
7
6
|
import { getRouteTypedFields } from './hooks';
|
|
8
7
|
import { VERSION } from '../version';
|
|
9
|
-
import { ConfirmResetPassword, ConfirmSignIn, ConfirmSignUp, ConfirmVerifyUser, ForceNewPassword,
|
|
8
|
+
import { ConfirmResetPassword, ConfirmSignIn, ConfirmSignUp, ConfirmVerifyUser, ForceNewPassword, ForgotPassword, SetupTotp, SignIn, SignUp, VerifyUser, } from './Defaults';
|
|
10
9
|
const DEFAULTS = {
|
|
11
10
|
ConfirmResetPassword,
|
|
12
11
|
ConfirmSignIn,
|
|
13
12
|
ConfirmSignUp,
|
|
14
13
|
ConfirmVerifyUser,
|
|
15
14
|
ForceNewPassword,
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
ForgotPassword,
|
|
16
|
+
SetupTotp,
|
|
18
17
|
SignIn,
|
|
19
18
|
SignUp,
|
|
20
19
|
VerifyUser,
|
|
@@ -25,22 +24,26 @@ const routePropSelector = ({ route, }) => [
|
|
|
25
24
|
function Authenticator({ children, components: overrides, Container = DefaultContainer, Footer, Header, ...options }) {
|
|
26
25
|
useDeprecationWarning({
|
|
27
26
|
message: 'The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.',
|
|
28
|
-
shouldWarn: !!options?.passwordSettings,
|
|
27
|
+
// shouldWarn: !!options?.passwordSettings,
|
|
28
|
+
/**
|
|
29
|
+
* @migration turn off until getConfig returns zero config
|
|
30
|
+
*/
|
|
31
|
+
shouldWarn: false,
|
|
32
|
+
});
|
|
33
|
+
useSetUserAgent({
|
|
34
|
+
componentName: 'Authenticator',
|
|
35
|
+
packageName: 'react-native',
|
|
36
|
+
version: VERSION,
|
|
29
37
|
});
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
configureComponent({
|
|
32
|
-
packageName: '@aws-amplify/ui-react-native',
|
|
33
|
-
version: VERSION,
|
|
34
|
-
});
|
|
35
|
-
}, []);
|
|
36
38
|
useAuthenticatorInitMachine(options);
|
|
37
|
-
const {
|
|
39
|
+
const { fields, route } = useAuthenticator(routePropSelector);
|
|
38
40
|
const components = useMemo(
|
|
39
41
|
// allow any to prevent TS from assuming that all fields are of type `TextFieldOptions`
|
|
40
42
|
() => resolveAuthenticatorComponents(DEFAULTS, overrides), [overrides]);
|
|
41
43
|
const { Component, props } = useAuthenticatorRoute({ components });
|
|
42
44
|
const typedFields = getRouteTypedFields({ fields, route });
|
|
43
|
-
|
|
45
|
+
const isAuthenticatedRoute = route === 'authenticated' || route === 'signOut';
|
|
46
|
+
if (isAuthenticatedRoute) {
|
|
44
47
|
return children ? <>{children}</> : null;
|
|
45
48
|
}
|
|
46
49
|
return (<SafeAreaProvider>
|
|
@@ -61,8 +64,8 @@ Authenticator.ConfirmSignIn = ConfirmSignIn;
|
|
|
61
64
|
Authenticator.ConfirmSignUp = ConfirmSignUp;
|
|
62
65
|
Authenticator.ConfirmVerifyUser = ConfirmVerifyUser;
|
|
63
66
|
Authenticator.ForceNewPassword = ForceNewPassword;
|
|
64
|
-
Authenticator.
|
|
65
|
-
Authenticator.
|
|
67
|
+
Authenticator.ForgotPassword = ForgotPassword;
|
|
68
|
+
Authenticator.SetupTotp = SetupTotp;
|
|
66
69
|
Authenticator.SignIn = SignIn;
|
|
67
70
|
Authenticator.SignUp = SignUp;
|
|
68
71
|
Authenticator.VerifyUser = VerifyUser;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DefaultFooter, DefaultHeader } from '../../common';
|
|
3
|
-
import {
|
|
3
|
+
import { DefaultForgotPasswordProps } from '../types';
|
|
4
4
|
declare const ResetPassword: {
|
|
5
|
-
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }:
|
|
5
|
+
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }: DefaultForgotPasswordProps): JSX.Element;
|
|
6
6
|
Footer: typeof DefaultFooter;
|
|
7
7
|
FormFields: {
|
|
8
8
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("../../common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
3
|
import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, } from '../../common';
|
|
4
4
|
import { useFieldValues } from '../../hooks';
|
|
5
|
-
const COMPONENT_NAME = '
|
|
5
|
+
const COMPONENT_NAME = 'ForgotPassword';
|
|
6
6
|
const { getResetYourPasswordText, getSendCodeText, getSendingText, getBackToSignInText, } = authenticatorTextUtil;
|
|
7
7
|
const ResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }) => {
|
|
8
8
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = useFieldValues({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ForgotPassword } from './ForgotPassword';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ForgotPassword } from './ForgotPassword';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DefaultFooter, DefaultHeader } from '../../common';
|
|
3
|
-
import {
|
|
4
|
-
declare const
|
|
5
|
-
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }:
|
|
3
|
+
import { DefaultSetupTotpProps } from '../types';
|
|
4
|
+
declare const SetupTotp: {
|
|
5
|
+
({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }: DefaultSetupTotpProps): JSX.Element;
|
|
6
6
|
Footer: typeof DefaultFooter;
|
|
7
7
|
FormFields: {
|
|
8
8
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("../../common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -11,4 +11,4 @@ declare const SetupTOTP: {
|
|
|
11
11
|
Header: typeof DefaultHeader;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
|
-
export default
|
|
14
|
+
export default SetupTotp;
|
|
@@ -4,9 +4,9 @@ import { Label } from '../../../primitives';
|
|
|
4
4
|
import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, } from '../../common';
|
|
5
5
|
import { useFieldValues } from '../../hooks';
|
|
6
6
|
import { styles } from './styles';
|
|
7
|
-
const COMPONENT_NAME = '
|
|
8
|
-
const { getBackToSignInText, getConfirmingText, getConfirmText,
|
|
9
|
-
const
|
|
7
|
+
const COMPONENT_NAME = 'SetupTotp';
|
|
8
|
+
const { getBackToSignInText, getConfirmingText, getConfirmText, getSetupTotpText, getSetupTotpInstructionsText, } = authenticatorTextUtil;
|
|
9
|
+
const SetupTotp = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }) => {
|
|
10
10
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = useFieldValues({
|
|
11
11
|
componentName: COMPONENT_NAME,
|
|
12
12
|
fields,
|
|
@@ -15,12 +15,12 @@ const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending,
|
|
|
15
15
|
handleSubmit,
|
|
16
16
|
validationErrors,
|
|
17
17
|
});
|
|
18
|
-
const headerText =
|
|
18
|
+
const headerText = getSetupTotpText();
|
|
19
19
|
const primaryButtonText = isPending ? getConfirmingText() : getConfirmText();
|
|
20
20
|
const secondaryButtonText = getBackToSignInText();
|
|
21
21
|
const body = (<>
|
|
22
22
|
<Label style={styles.secretKeyText}>
|
|
23
|
-
{
|
|
23
|
+
{getSetupTotpInstructionsText()}
|
|
24
24
|
</Label>
|
|
25
25
|
<Label selectable style={styles.secretKeyText}>
|
|
26
26
|
{totpSecretCode}
|
|
@@ -42,8 +42,8 @@ const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending,
|
|
|
42
42
|
]);
|
|
43
43
|
return (<DefaultContent {...rest} body={body} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export default
|
|
45
|
+
SetupTotp.Footer = DefaultFooter;
|
|
46
|
+
SetupTotp.FormFields = DefaultTextFormFields;
|
|
47
|
+
SetupTotp.Header = DefaultHeader;
|
|
48
|
+
SetupTotp.displayName = COMPONENT_NAME;
|
|
49
|
+
export default SetupTotp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SetupTotp } from './SetupTotp';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SetupTotp } from './SetupTotp';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DefaultFooter, DefaultHeader } from '../../common';
|
|
3
3
|
import { DefaultSignInProps } from '../types';
|
|
4
4
|
declare const SignIn: {
|
|
5
|
-
({ fields, handleBlur, handleChange, handleSubmit, hideSignUp,
|
|
5
|
+
({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, socialProviders, toFederatedSignIn, toForgotPassword, toSignUp, validationErrors, ...rest }: DefaultSignInProps): JSX.Element;
|
|
6
6
|
Footer: typeof DefaultFooter;
|
|
7
7
|
FormFields: {
|
|
8
8
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("../../common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
-
import { DefaultFooter, DefaultTextFormFields, DefaultHeader, DefaultContent, } from '../../common';
|
|
3
|
+
import { DefaultFooter, DefaultTextFormFields, DefaultHeader, DefaultContent, FederatedProviderButtons, } from '../../common';
|
|
4
4
|
import { useFieldValues } from '../../hooks';
|
|
5
5
|
const COMPONENT_NAME = 'SignIn';
|
|
6
|
-
const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp,
|
|
6
|
+
const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, socialProviders, toFederatedSignIn, toForgotPassword, toSignUp, validationErrors, ...rest }) => {
|
|
7
7
|
const { getSignInTabText, getSignInText, getSignUpTabText, getForgotPasswordText, } = authenticatorTextUtil;
|
|
8
8
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = useFieldValues({
|
|
9
9
|
componentName: COMPONENT_NAME,
|
|
@@ -17,10 +17,11 @@ const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, to
|
|
|
17
17
|
const forgotPasswordText = getForgotPasswordText(true);
|
|
18
18
|
const signInText = getSignInText();
|
|
19
19
|
const signUpText = getSignUpTabText();
|
|
20
|
+
const body = socialProviders ? (<FederatedProviderButtons route="signIn" socialProviders={socialProviders} toFederatedSignIn={toFederatedSignIn}/>) : null;
|
|
20
21
|
const buttons = useMemo(() => {
|
|
21
22
|
const forgotPassword = {
|
|
22
23
|
children: forgotPasswordText,
|
|
23
|
-
onPress:
|
|
24
|
+
onPress: toForgotPassword,
|
|
24
25
|
};
|
|
25
26
|
return {
|
|
26
27
|
primary: { children: signInText, disabled, onPress: handleFormSubmit },
|
|
@@ -35,10 +36,10 @@ const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, to
|
|
|
35
36
|
hideSignUp,
|
|
36
37
|
signInText,
|
|
37
38
|
signUpText,
|
|
38
|
-
|
|
39
|
+
toForgotPassword,
|
|
39
40
|
toSignUp,
|
|
40
41
|
]);
|
|
41
|
-
return (<DefaultContent {...rest} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} validationErrors={fieldValidationErrors}/>);
|
|
42
|
+
return (<DefaultContent {...rest} body={body} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} validationErrors={fieldValidationErrors}/>);
|
|
42
43
|
};
|
|
43
44
|
SignIn.Footer = DefaultFooter;
|
|
44
45
|
SignIn.FormFields = DefaultTextFormFields;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DefaultFooter, DefaultHeader } from '../../common';
|
|
3
3
|
import { DefaultSignUpProps } from '../types';
|
|
4
4
|
declare const SignUp: {
|
|
5
|
-
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, toSignIn, validationErrors, ...rest }: DefaultSignUpProps): JSX.Element;
|
|
5
|
+
({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, socialProviders, toFederatedSignIn, toSignIn, validationErrors, ...rest }: DefaultSignUpProps): JSX.Element;
|
|
6
6
|
Footer: typeof DefaultFooter;
|
|
7
7
|
FormFields: {
|
|
8
8
|
({ fieldContainerStyle, fieldErrorsContainer, fieldErrorStyle, fieldStyle, fields, isPending, style, validationErrors, }: import("../../common/DefaultFormFields/types").DefaultTextFormFieldsProps): JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
-
import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, } from '../../common';
|
|
3
|
+
import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, FederatedProviderButtons, } from '../../common';
|
|
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, hasValidationErrors, hideSignIn, isPending, toSignIn, validationErrors, ...rest }) => {
|
|
7
|
+
const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, socialProviders, toFederatedSignIn, toSignIn, validationErrors, ...rest }) => {
|
|
8
8
|
const { disableFormSubmit, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = useFieldValues({
|
|
9
9
|
componentName: COMPONENT_NAME,
|
|
10
10
|
fields,
|
|
@@ -19,6 +19,7 @@ const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationE
|
|
|
19
19
|
? getCreatingAccountText()
|
|
20
20
|
: getCreateAccountText();
|
|
21
21
|
const secondaryButtonText = getSignInTabText();
|
|
22
|
+
const body = socialProviders ? (<FederatedProviderButtons route="signUp" socialProviders={socialProviders} toFederatedSignIn={toFederatedSignIn}/>) : null;
|
|
22
23
|
const buttons = useMemo(() => ({
|
|
23
24
|
primary: {
|
|
24
25
|
children: primaryButtonText,
|
|
@@ -36,7 +37,7 @@ const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationE
|
|
|
36
37
|
secondaryButtonText,
|
|
37
38
|
toSignIn,
|
|
38
39
|
]);
|
|
39
|
-
return (<DefaultContent {...rest} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
40
|
+
return (<DefaultContent {...rest} body={body} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
40
41
|
};
|
|
41
42
|
SignUp.Footer = DefaultFooter;
|
|
42
43
|
SignUp.FormFields = DefaultTextFormFields;
|
|
@@ -3,8 +3,8 @@ export { ConfirmSignIn } from './ConfirmSignIn';
|
|
|
3
3
|
export { ConfirmSignUp } from './ConfirmSignUp';
|
|
4
4
|
export { ConfirmVerifyUser } from './ConfirmVerifyUser';
|
|
5
5
|
export { ForceNewPassword } from './ForceNewPassword';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { ForgotPassword } from './ForgotPassword';
|
|
7
|
+
export { SetupTotp } from './SetupTotp';
|
|
8
8
|
export { SignIn } from './SignIn';
|
|
9
9
|
export { SignUp } from './SignUp';
|
|
10
10
|
export { VerifyUser } from './VerifyUser';
|
|
@@ -3,8 +3,8 @@ export { ConfirmSignIn } from './ConfirmSignIn';
|
|
|
3
3
|
export { ConfirmSignUp } from './ConfirmSignUp';
|
|
4
4
|
export { ConfirmVerifyUser } from './ConfirmVerifyUser';
|
|
5
5
|
export { ForceNewPassword } from './ForceNewPassword';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { ForgotPassword } from './ForgotPassword';
|
|
7
|
+
export { SetupTotp } from './SetupTotp';
|
|
8
8
|
export { SignIn } from './SignIn';
|
|
9
9
|
export { SignUp } from './SignUp';
|
|
10
10
|
export { VerifyUser } from './VerifyUser';
|
|
@@ -13,7 +13,7 @@ export interface ForceNewPasswordStyle {
|
|
|
13
13
|
}
|
|
14
14
|
export interface ResetPasswordStyle {
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface SetupTotpStyle {
|
|
17
17
|
}
|
|
18
18
|
export interface SignInStyle {
|
|
19
19
|
}
|
|
@@ -37,12 +37,12 @@ export type DefaultConfirmVerifyUserProps = React.ComponentPropsWithoutRef<Defau
|
|
|
37
37
|
export type DefaultForceNewPasswordProps = React.ComponentPropsWithoutRef<DefaultComponents<TextFieldOptionsType, {
|
|
38
38
|
style?: ForceNewPasswordStyle;
|
|
39
39
|
}>['ForceNewPassword']>;
|
|
40
|
-
export type
|
|
40
|
+
export type DefaultForgotPasswordProps = React.ComponentPropsWithoutRef<DefaultComponents<TextFieldOptionsType, {
|
|
41
41
|
style?: ResetPasswordStyle;
|
|
42
|
-
}>['
|
|
43
|
-
export type
|
|
44
|
-
style?:
|
|
45
|
-
}>['
|
|
42
|
+
}>['ForgotPassword']>;
|
|
43
|
+
export type DefaultSetupTotpProps = React.ComponentPropsWithoutRef<DefaultComponents<TextFieldOptionsType, {
|
|
44
|
+
style?: SetupTotpStyle;
|
|
45
|
+
}>['SetupTotp']>;
|
|
46
46
|
export type DefaultSignInProps = React.ComponentPropsWithoutRef<DefaultComponents<TextFieldOptionsType, {
|
|
47
47
|
style?: SignInStyle;
|
|
48
48
|
}>['SignIn']>;
|
|
@@ -73,10 +73,10 @@ type ForceNewPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType
|
|
|
73
73
|
} & P>['ForceNewPassword'];
|
|
74
74
|
type ResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
75
75
|
style?: ResetPasswordStyle;
|
|
76
|
-
} & P>['
|
|
77
|
-
type
|
|
78
|
-
style?:
|
|
79
|
-
} & P>['
|
|
76
|
+
} & P>['ForgotPassword'];
|
|
77
|
+
type SetupTotpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
78
|
+
style?: SetupTotpStyle;
|
|
79
|
+
} & P>['SetupTotp'];
|
|
80
80
|
type SignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
81
81
|
style?: SignInStyle;
|
|
82
82
|
} & P>['SignIn'];
|
|
@@ -96,7 +96,7 @@ export interface Components {
|
|
|
96
96
|
ConfirmVerifyUser?: ConfirmVerifyUserComponent;
|
|
97
97
|
ForceNewPassword?: ForceNewPasswordComponent;
|
|
98
98
|
ResetPassword?: ResetPasswordComponent;
|
|
99
|
-
|
|
99
|
+
SetupTotp?: SetupTotpComponent;
|
|
100
100
|
SignIn?: SignInComponent;
|
|
101
101
|
SignUp?: SignUpComponent;
|
|
102
102
|
VerifyUser?: VerifyUserComponent;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, Icon, Label } from '../../../primitives';
|
|
3
3
|
import { usePressableContainerStyles } from '../../../hooks';
|
|
4
|
-
import { styles } from './styles';
|
|
5
4
|
export default function FederatedProviderButton({ children, source, style, textStyle, ...rest }) {
|
|
6
5
|
const pressableStyle = usePressableContainerStyles({
|
|
7
|
-
containerStyle: styles.container,
|
|
8
6
|
overrideStyle: style,
|
|
9
7
|
});
|
|
10
8
|
return (<Button {...rest} style={pressableStyle}>
|
|
11
|
-
<Icon source={source}
|
|
12
|
-
<Label style={
|
|
9
|
+
<Icon source={source} size={20}/>
|
|
10
|
+
<Label style={textStyle}>{children}</Label>
|
|
13
11
|
</Button>);
|
|
14
12
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ImageSourcePropType, ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
3
|
import { ButtonProps } from '../../../primitives';
|
|
3
|
-
export interface FederatedProviderButtonProps extends ButtonProps {
|
|
4
|
+
export interface FederatedProviderButtonProps extends Omit<ButtonProps, 'children'> {
|
|
5
|
+
children?: React.ReactNode;
|
|
4
6
|
source: ImageSourcePropType;
|
|
5
7
|
}
|
|
6
8
|
export interface FederatedProviderButtonStyles {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FederatedProviderButtonsProps } from './types';
|
|
3
|
-
export default function FederatedProviderButtons({ socialProviders,
|
|
3
|
+
export default function FederatedProviderButtons({ buttonStyle, dividerLabelStyle, route, socialProviders, style, }: FederatedProviderButtonsProps): JSX.Element | null;
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { FederatedProviderButton } from '../FederatedProviderButton';
|
|
3
|
+
import { signInWithRedirect } from 'aws-amplify/auth';
|
|
4
|
+
import { authenticatorTextUtil, capitalize, } from '@aws-amplify/ui';
|
|
6
5
|
import { Divider } from '../../../primitives';
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { useTheme } from '../../../theme';
|
|
7
|
+
import { FederatedProviderButton } from '../FederatedProviderButton';
|
|
8
|
+
import { icons } from '../../../assets';
|
|
9
|
+
import { getThemedStyles } from './styles';
|
|
10
|
+
const { getSignInWithFederationText, getOrText } = authenticatorTextUtil;
|
|
11
|
+
// use `signInWithRedirect` directly instead of `toFederatedSignIn`
|
|
12
|
+
// exposed on `useAuthenticator` for RN. `@aws-amplify/rtn-web-browser`
|
|
13
|
+
// does not emit an event on federated sign in flow cancellation,
|
|
14
|
+
// preventing the `Authenticator` from updating state and leaving the
|
|
15
|
+
// UI in a "pending" state
|
|
16
|
+
const handleSignInWithRedirect = (provider) => signInWithRedirect({ provider: capitalize(provider) });
|
|
17
|
+
export default function FederatedProviderButtons({ buttonStyle, dividerLabelStyle, route, socialProviders, style, }) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const themedStyle = getThemedStyles(theme);
|
|
9
20
|
const providerButtons = useMemo(() => socialProviders?.map((provider) => {
|
|
10
21
|
const providerIconSource = icons[`${provider}Logo`];
|
|
11
22
|
const handlePress = () => {
|
|
12
|
-
|
|
23
|
+
handleSignInWithRedirect(provider);
|
|
13
24
|
};
|
|
14
|
-
return (<FederatedProviderButton key={provider} onPress={handlePress} source={providerIconSource} style={
|
|
15
|
-
{
|
|
25
|
+
return (<FederatedProviderButton key={provider} onPress={handlePress} source={providerIconSource} style={[themedStyle.button, buttonStyle]}>
|
|
26
|
+
{getSignInWithFederationText(route, provider)}
|
|
16
27
|
</FederatedProviderButton>);
|
|
17
|
-
}), [socialProviders,
|
|
18
|
-
return providerButtons?.length ? (<View style={
|
|
28
|
+
}), [route, socialProviders, themedStyle, buttonStyle]);
|
|
29
|
+
return providerButtons?.length ? (<View style={[themedStyle.container, style]} testID="amplify__federated-provider-buttons">
|
|
19
30
|
{providerButtons}
|
|
20
|
-
<Divider labelStyle={
|
|
31
|
+
<Divider labelStyle={[themedStyle.dividerLabel, dividerLabelStyle]}>
|
|
32
|
+
{getOrText()}
|
|
33
|
+
</Divider>
|
|
21
34
|
</View>) : null;
|
|
22
35
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
export const getThemedStyles = (theme) => {
|
|
3
|
+
const { space } = theme.tokens;
|
|
4
|
+
return StyleSheet.create({
|
|
5
|
+
button: {
|
|
6
|
+
marginVertical: space.xs,
|
|
7
|
+
},
|
|
8
|
+
dividerLabel: {
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
},
|
|
11
|
+
container: {
|
|
12
|
+
marginHorizontal: space.small,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
5
15
|
};
|