@aws-amplify/ui-react-native 1.2.27 → 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/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- 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/lib/version.js +1 -1
- 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/src/version.ts +1 -1
- 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
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TextStyle, ViewStyle } from 'react-native';
|
|
1
|
+
import { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
2
2
|
import { AuthenticatorMachineContext } from '@aws-amplify/ui-react-core';
|
|
3
|
-
export interface FederatedProviderButtonsProps extends Pick<AuthenticatorMachineContext, 'socialProviders' | 'toFederatedSignIn'
|
|
3
|
+
export interface FederatedProviderButtonsProps extends Pick<AuthenticatorMachineContext, 'route' | 'socialProviders' | 'toFederatedSignIn'>, ViewProps {
|
|
4
|
+
buttonStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
dividerLabelStyle?: StyleProp<TextStyle>;
|
|
4
6
|
}
|
|
5
7
|
export interface FederatedProviderButtonStyle {
|
|
6
8
|
button: ViewStyle;
|
|
7
9
|
container: ViewStyle;
|
|
8
|
-
|
|
10
|
+
dividerLabel: TextStyle;
|
|
9
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
|
-
import { Logger } from 'aws-amplify';
|
|
2
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
3
3
|
import { getSanitizedTextFields, getSanitizedRadioFields, isRadioFieldOptions, runFieldValidation, } from './utils';
|
|
4
4
|
const logger = new Logger('Authenticator');
|
|
5
5
|
export default function useFieldValues({ componentName, fields = [], handleBlur, handleChange, handleSubmit, validationErrors, }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from 'aws-amplify';
|
|
1
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
2
2
|
import { authenticatorTextUtil, isString, isUnverifiedContactMethodType, isValidEmail, UnverifiedContactMethodType, } from '@aws-amplify/ui';
|
|
3
3
|
import { isAuthenticatorComponentRouteKey, } from '@aws-amplify/ui-react-core';
|
|
4
4
|
import { KEY_ALLOW_LIST } from './constants';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { AuthenticatorMachineOptions } from '@aws-amplify/ui';
|
|
3
3
|
import { DefaultContainerComponent } from './common';
|
|
4
4
|
import { Components } from './Defaults';
|
|
5
|
-
type SupportedAuthenticatorMachineOptions = Omit<AuthenticatorMachineOptions, '
|
|
5
|
+
type SupportedAuthenticatorMachineOptions = Omit<AuthenticatorMachineOptions, 'formFields'>;
|
|
6
6
|
export interface AuthenticatorProps extends SupportedAuthenticatorMachineOptions {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
Container?: DefaultContainerComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Linking } from 'react-native';
|
|
2
|
-
import { ConsoleLogger as Logger } from '
|
|
3
|
-
const logger = new Logger('
|
|
2
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
3
|
+
const logger = new Logger('InAppMessaging');
|
|
4
4
|
const handleMessageLinkAction = async (url) => {
|
|
5
5
|
let supported = false;
|
|
6
6
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InAppMessageImage, InAppMessageLayout } 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
|
|
@@ -7,4 +7,4 @@ import { UseMessageImage } from './types';
|
|
|
7
7
|
* @param layout message layout
|
|
8
8
|
* @returns message image dimensions and rendering related booleans
|
|
9
9
|
*/
|
|
10
|
-
export default function useMessageImage(image:
|
|
10
|
+
export default function useMessageImage(image: InAppMessageImage | undefined, layout: InAppMessageLayout): UseMessageImage;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Image } from 'react-native';
|
|
3
|
-
import { ConsoleLogger as Logger } from '
|
|
3
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
4
4
|
import { ImagePrefetchStatus } from './types';
|
|
5
5
|
import { getLayoutImageDimensions, prefetchNetworkImage } from './utils';
|
|
6
|
-
const logger = new Logger('
|
|
6
|
+
const logger = new Logger('InAppMessaging');
|
|
7
7
|
/**
|
|
8
8
|
* Handles prefetching and dimension setting for message images
|
|
9
9
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InAppMessageLayout } 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
|
-
export declare const getLayoutImageDimensions: (imageHeight: number, imageWidth: number, layout:
|
|
4
|
+
export declare const getLayoutImageDimensions: (imageHeight: number, imageWidth: number, layout: InAppMessageLayout) => ImageDimensions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image } from 'react-native';
|
|
2
|
-
import { ConsoleLogger as Logger } from '
|
|
2
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
3
3
|
import { BANNER_IMAGE_SCREEN_SIZE, CAROUSEL_IMAGE_SCREEN_SIZE, FULL_SCREEN_IMAGE_SCREEN_SIZE, MODAL_IMAGE_SCREEN_SIZE, } from './constants';
|
|
4
|
-
const logger = new Logger('
|
|
4
|
+
const logger = new Logger('InAppMessaging');
|
|
5
5
|
const inAppMessageImageSizes = {
|
|
6
6
|
BOTTOM_BANNER: BANNER_IMAGE_SCREEN_SIZE,
|
|
7
7
|
MIDDLE_BANNER: BANNER_IMAGE_SCREEN_SIZE,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColorValue, ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { InAppMessageLayout, MessagePayloadStyle } from '@aws-amplify/ui-react-core-notifications';
|
|
3
3
|
import { ButtonProps } from '../../../primitives';
|
|
4
4
|
import { ImageDimensions } from '../useMessageImage';
|
|
5
5
|
/**
|
|
@@ -35,7 +35,7 @@ export interface MessageStyleParams {
|
|
|
35
35
|
/**
|
|
36
36
|
* message specific layout
|
|
37
37
|
*/
|
|
38
|
-
layout:
|
|
38
|
+
layout: InAppMessageLayout;
|
|
39
39
|
/**
|
|
40
40
|
* style params to derive resolved style from
|
|
41
41
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InAppMessageLayout, MessageComponentBaseProps, 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
|
|
@@ -13,7 +13,7 @@ export declare const getComponentButtonStyle: ({ styleParams, buttonType, }: Mes
|
|
|
13
13
|
* @param {InAppMessageLayout} layout - message layout
|
|
14
14
|
* @returns {Boolean} boolean indicating whether entire screen should be filled
|
|
15
15
|
*/
|
|
16
|
-
export declare const shouldFillDeviceScreen: (layout:
|
|
16
|
+
export declare const shouldFillDeviceScreen: (layout: InAppMessageLayout) => boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Parse and assign appropriate message container and wrapper style from style params
|
|
19
19
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { InAppMessagingProvider, useInAppMessaging, } from '@aws-amplify/ui-react-core-notifications';
|
|
1
|
+
export { InAppMessage, InAppMessageAction, InAppMessageButton, InAppMessageContent, InAppMessageImage, InAppMessageLayout, InAppMessagingProvider, InAppMessageStyle, InAppMessageTextAlign, useInAppMessaging, } from '@aws-amplify/ui-react-core-notifications';
|
|
2
2
|
export { BannerMessageProps, CarouselMessageProps, FullScreenMessageProps, ModalMessageProps, InAppMessageDisplay, MessageComponents, withInAppMessaging, } from './components';
|
|
@@ -5,8 +5,10 @@ export const getThemedStyles = (theme) => {
|
|
|
5
5
|
return StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
alignItems: 'center',
|
|
8
|
-
backgroundColor: colors.transparent,
|
|
9
8
|
justifyContent: 'center',
|
|
9
|
+
flexDirection: 'row',
|
|
10
|
+
gap: space.small,
|
|
11
|
+
backgroundColor: colors.transparent,
|
|
10
12
|
paddingVertical: space.small,
|
|
11
13
|
paddingHorizontal: space.medium,
|
|
12
14
|
borderRadius: radii.small,
|
|
@@ -18,7 +20,7 @@ export const getThemedStyles = (theme) => {
|
|
|
18
20
|
...components?.button?.containerDefault,
|
|
19
21
|
},
|
|
20
22
|
containerPrimary: {
|
|
21
|
-
backgroundColor: colors.
|
|
23
|
+
backgroundColor: colors.primary[80],
|
|
22
24
|
...components?.button?.containerPrimary,
|
|
23
25
|
},
|
|
24
26
|
containerLink: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Dimensions, FlatList, View, } from 'react-native';
|
|
3
|
-
import { isFunction } from '@aws-amplify/ui';
|
|
4
3
|
import CarouselPageIndicator from './CarouselPageIndicator';
|
|
5
4
|
import { VIEWABILITY_CONFIG } from './constants';
|
|
6
5
|
import { styles } from './styles';
|
|
@@ -37,16 +36,7 @@ export default function Carousel(props) {
|
|
|
37
36
|
updateOrientation(window.width);
|
|
38
37
|
};
|
|
39
38
|
const subscription = Dimensions.addEventListener('change', orientationHandler);
|
|
40
|
-
|
|
41
|
-
// available so try to remove via a `EmitterSubscription` first before falling back to `removeEventListener`
|
|
42
|
-
return () => {
|
|
43
|
-
if (isFunction(subscription?.remove)) {
|
|
44
|
-
subscription.remove();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
Dimensions.removeEventListener('change', orientationHandler);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
39
|
+
return subscription.remove;
|
|
50
40
|
}, [updateOrientation]);
|
|
51
41
|
const carouselRenderItem = (renderInfo) => (<View style={{ width }}>{renderItem(renderInfo)}</View>);
|
|
52
42
|
if (!data?.length) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
export const getThemedStyles = (theme) => {
|
|
3
3
|
const { tokens, components } = theme;
|
|
4
|
-
const { colors, fontSizes, space } = tokens;
|
|
4
|
+
const { colors, fontSizes, space, borderWidths } = tokens;
|
|
5
5
|
return StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
alignItems: 'center',
|
|
@@ -12,12 +12,13 @@ export const getThemedStyles = (theme) => {
|
|
|
12
12
|
fontSize: fontSizes.medium,
|
|
13
13
|
margin: space.medium,
|
|
14
14
|
textAlign: 'center',
|
|
15
|
+
color: colors.font.tertiary,
|
|
15
16
|
...components?.divider?.label,
|
|
16
17
|
},
|
|
17
18
|
line: {
|
|
18
|
-
backgroundColor: colors.
|
|
19
|
+
backgroundColor: colors.border.secondary,
|
|
19
20
|
flex: 1,
|
|
20
|
-
height:
|
|
21
|
+
height: borderWidths.small,
|
|
21
22
|
...components?.divider?.line,
|
|
22
23
|
},
|
|
23
24
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ErrorMessageProps } from './types';
|
|
3
3
|
export declare const CLOSE_BUTTON_TEST_ID = "authenticator--error-message--close-button";
|
|
4
|
-
export default function ErrorMessage({ children, iconStyle, labelStyle, onDismiss, style, ...rest }: ErrorMessageProps): JSX.Element;
|
|
4
|
+
export default function ErrorMessage({ accessible, accessibilityRole, children, iconStyle, labelStyle, onDismiss, style, ...rest }: ErrorMessageProps): JSX.Element;
|
|
@@ -6,10 +6,10 @@ import { IconButton } from '../IconButton';
|
|
|
6
6
|
import { useTheme } from '../../theme';
|
|
7
7
|
import { getThemedStyles } from './styles';
|
|
8
8
|
export const CLOSE_BUTTON_TEST_ID = 'authenticator--error-message--close-button';
|
|
9
|
-
export default function ErrorMessage({ children, iconStyle, labelStyle, onDismiss, style, ...rest }) {
|
|
9
|
+
export default function ErrorMessage({ accessible = true, accessibilityRole = 'alert', children, iconStyle, labelStyle, onDismiss, style, ...rest }) {
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
const themedStyle = getThemedStyles(theme);
|
|
12
|
-
return (<View {...rest} accessibilityRole=
|
|
12
|
+
return (<View {...rest} accessible={accessible} accessibilityRole={accessibilityRole} style={[themedStyle.container, style]}>
|
|
13
13
|
<Icon size={20} source={icons.error} style={[themedStyle.icon, iconStyle]}/>
|
|
14
14
|
<Text style={[themedStyle.label, labelStyle]}>{children}</Text>
|
|
15
15
|
{onDismiss ? (<IconButton onPress={onDismiss} size={20} source={icons.close} style={themedStyle.icon} testID={CLOSE_BUTTON_TEST_ID}/>) : null}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProps } from './types';
|
|
3
|
-
export default function Icon({ accessibilityRole, animated, color, size, style, ...rest }: IconProps): JSX.Element;
|
|
3
|
+
export default function Icon({ accessible, accessibilityRole, animated, color, size, style, ...rest }: IconProps): JSX.Element;
|
|
@@ -2,11 +2,12 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { Animated, Image } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../theme';
|
|
4
4
|
import { getThemedStyles } from './styles';
|
|
5
|
-
export default function Icon({ accessibilityRole = 'image', animated, color, size, style, ...rest }) {
|
|
5
|
+
export default function Icon({ accessible = true, accessibilityRole = 'image', animated, color, size, style, ...rest }) {
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
const themedStyle = useMemo(() => getThemedStyles(theme, color, size), [theme, color, size]);
|
|
8
8
|
const imageProps = {
|
|
9
9
|
...rest,
|
|
10
|
+
accessible,
|
|
10
11
|
accessibilityRole,
|
|
11
12
|
style: [themedStyle.icon, style],
|
|
12
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { ConsoleLogger as Logger } from '
|
|
2
|
+
import { ConsoleLogger as Logger } from 'aws-amplify/utils';
|
|
3
3
|
import { iconSizes } from './constants';
|
|
4
4
|
const logger = new Logger('Icon-logger');
|
|
5
5
|
const getIconSize = (size) => {
|
|
@@ -26,7 +26,7 @@ export const getThemedStyles = (theme) => {
|
|
|
26
26
|
...components?.radio?.radioContainer,
|
|
27
27
|
},
|
|
28
28
|
radioDot: {
|
|
29
|
-
backgroundColor: colors.
|
|
29
|
+
backgroundColor: colors.primary[80],
|
|
30
30
|
borderRadius: ROUNDED_BORDER_RADIUS,
|
|
31
31
|
...components?.radio?.radioDot,
|
|
32
32
|
},
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioGroupProps } from './types';
|
|
3
|
-
export default function RadioGroup<T>({ accessibilityRole, children, direction, disabled, initialValue, label, labelPosition, labelStyle, onChange, onValueChange, size, style, ...rest }: RadioGroupProps<T>): JSX.Element;
|
|
3
|
+
export default function RadioGroup<T>({ accessible, accessibilityRole, children, direction, disabled, initialValue, label, labelPosition, labelStyle, onChange, onValueChange, size, style, ...rest }: RadioGroupProps<T>): JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { useTheme } from '../../theme';
|
|
|
5
5
|
import { Label } from '../Label';
|
|
6
6
|
import { getFlexDirectionFromLabelPosition } from '../Label/utils';
|
|
7
7
|
import { getThemedStyles } from './styles';
|
|
8
|
-
export default function RadioGroup({ accessibilityRole = 'radiogroup', children, direction = 'vertical', disabled, initialValue, label, labelPosition = 'top', labelStyle, onChange, onValueChange, size, style, ...rest }) {
|
|
8
|
+
export default function RadioGroup({ accessible = true, accessibilityRole = 'radiogroup', children, direction = 'vertical', disabled, initialValue, label, labelPosition = 'top', labelStyle, onChange, onValueChange, size, style, ...rest }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const themedStyle = getThemedStyles(theme);
|
|
11
11
|
const [value, setValue] = useState(initialValue);
|
|
@@ -27,7 +27,7 @@ export default function RadioGroup({ accessibilityRole = 'radiogroup', children,
|
|
|
27
27
|
onChange?.(nextValue);
|
|
28
28
|
}, [onChange]);
|
|
29
29
|
return (<View {...rest} style={[themedStyle.container, containerStyle, style]}>
|
|
30
|
-
<View accessibilityRole={accessibilityRole} style={childContainerStyle}>
|
|
30
|
+
<View accessible={accessible} accessibilityRole={accessibilityRole} style={childContainerStyle}>
|
|
31
31
|
{Children.map(children, (child) => {
|
|
32
32
|
if (isValidElement(child)) {
|
|
33
33
|
const { disabled: childDisabled, onChange: childOnChange, value: childValue, size: childSize, } = child.props;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TabsProps } from './types';
|
|
3
|
-
export default function Tabs({ children, indicatorPosition, onChange, selectedIndex, style, ...rest }: TabsProps): JSX.Element;
|
|
3
|
+
export default function Tabs({ accessible, accessibilityRole, children, indicatorPosition, onChange, selectedIndex, style, ...rest }: TabsProps): JSX.Element;
|
|
@@ -2,13 +2,13 @@ import React, { Children, cloneElement, isValidElement } from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../theme';
|
|
4
4
|
import { getThemedStyles } from './styles';
|
|
5
|
-
export default function Tabs({ children, indicatorPosition = 'bottom', onChange, selectedIndex = 0, style, ...rest }) {
|
|
5
|
+
export default function Tabs({ accessible = true, accessibilityRole = 'tablist', children, indicatorPosition = 'bottom', onChange, selectedIndex = 0, style, ...rest }) {
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
const themedStyle = getThemedStyles(theme, indicatorPosition);
|
|
8
8
|
const handleOnChange = (nextIndex) => {
|
|
9
9
|
onChange?.(nextIndex);
|
|
10
10
|
};
|
|
11
|
-
return (<View {...rest} accessibilityRole=
|
|
11
|
+
return (<View {...rest} accessible={accessible} accessibilityRole={accessibilityRole} style={[themedStyle.tabList, style]}>
|
|
12
12
|
{Children.map(children, (child, index) => {
|
|
13
13
|
if (isValidElement(child)) {
|
|
14
14
|
return cloneElement(child, {
|
|
@@ -4,12 +4,12 @@ export const getThemedStyles = (theme, indicatorPosition) => {
|
|
|
4
4
|
const selectedTabBorderStyles = {};
|
|
5
5
|
const tabBorderStyles = {};
|
|
6
6
|
if (indicatorPosition && indicatorPosition === 'top') {
|
|
7
|
-
selectedTabBorderStyles.borderTopColor = colors.
|
|
7
|
+
selectedTabBorderStyles.borderTopColor = colors.primary[80];
|
|
8
8
|
tabBorderStyles.borderTopWidth = borderWidths.medium;
|
|
9
9
|
tabBorderStyles.borderTopColor = colors.border.secondary;
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
selectedTabBorderStyles.borderBottomColor = colors.
|
|
12
|
+
selectedTabBorderStyles.borderBottomColor = colors.primary[80];
|
|
13
13
|
tabBorderStyles.borderBottomWidth = borderWidths.medium;
|
|
14
14
|
tabBorderStyles.borderBottomColor = colors.border.secondary;
|
|
15
15
|
}
|
|
@@ -46,7 +46,7 @@ export const getThemedStyles = (theme, indicatorPosition) => {
|
|
|
46
46
|
},
|
|
47
47
|
selected: {
|
|
48
48
|
backgroundColor: colors.background.primary,
|
|
49
|
-
color: colors.
|
|
49
|
+
color: colors.primary[80],
|
|
50
50
|
...selectedTabBorderStyles,
|
|
51
51
|
...components?.tabs?.selected,
|
|
52
52
|
},
|
package/dist/utils/platform.d.ts
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.2.
|
|
1
|
+
export declare const VERSION = "1.2.28";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.2.
|
|
1
|
+
export const VERSION = '1.2.28';
|
|
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
6
|
const ui_react_core_1 = require("@aws-amplify/ui-react-core");
|
|
7
|
-
const ui_1 = require("@aws-amplify/ui");
|
|
8
7
|
const hooks_1 = require("../hooks");
|
|
9
8
|
const common_1 = require("./common");
|
|
10
9
|
const hooks_2 = require("./hooks");
|
|
@@ -16,8 +15,8 @@ const DEFAULTS = {
|
|
|
16
15
|
ConfirmSignUp: Defaults_1.ConfirmSignUp,
|
|
17
16
|
ConfirmVerifyUser: Defaults_1.ConfirmVerifyUser,
|
|
18
17
|
ForceNewPassword: Defaults_1.ForceNewPassword,
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
ForgotPassword: Defaults_1.ForgotPassword,
|
|
19
|
+
SetupTotp: Defaults_1.SetupTotp,
|
|
21
20
|
SignIn: Defaults_1.SignIn,
|
|
22
21
|
SignUp: Defaults_1.SignUp,
|
|
23
22
|
VerifyUser: Defaults_1.VerifyUser,
|
|
@@ -28,22 +27,26 @@ const routePropSelector = ({ route, }) => [
|
|
|
28
27
|
function Authenticator({ children, components: overrides, Container = common_1.DefaultContainer, Footer, Header, ...options }) {
|
|
29
28
|
(0, hooks_1.useDeprecationWarning)({
|
|
30
29
|
message: 'The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.',
|
|
31
|
-
shouldWarn: !!options?.passwordSettings,
|
|
30
|
+
// shouldWarn: !!options?.passwordSettings,
|
|
31
|
+
/**
|
|
32
|
+
* @migration turn off until getConfig returns zero config
|
|
33
|
+
*/
|
|
34
|
+
shouldWarn: false,
|
|
35
|
+
});
|
|
36
|
+
(0, ui_react_core_1.useSetUserAgent)({
|
|
37
|
+
componentName: 'Authenticator',
|
|
38
|
+
packageName: 'react-native',
|
|
39
|
+
version: version_1.VERSION,
|
|
32
40
|
});
|
|
33
|
-
react_1.default.useEffect(() => {
|
|
34
|
-
(0, ui_1.configureComponent)({
|
|
35
|
-
packageName: '@aws-amplify/ui-react-native',
|
|
36
|
-
version: version_1.VERSION,
|
|
37
|
-
});
|
|
38
|
-
}, []);
|
|
39
41
|
(0, ui_react_core_1.useAuthenticatorInitMachine)(options);
|
|
40
|
-
const {
|
|
42
|
+
const { fields, route } = (0, ui_react_core_1.useAuthenticator)(routePropSelector);
|
|
41
43
|
const components = (0, react_1.useMemo)(
|
|
42
44
|
// allow any to prevent TS from assuming that all fields are of type `TextFieldOptions`
|
|
43
45
|
() => (0, ui_react_core_1.resolveAuthenticatorComponents)(DEFAULTS, overrides), [overrides]);
|
|
44
46
|
const { Component, props } = (0, ui_react_core_1.useAuthenticatorRoute)({ components });
|
|
45
47
|
const typedFields = (0, hooks_2.getRouteTypedFields)({ fields, route });
|
|
46
|
-
|
|
48
|
+
const isAuthenticatedRoute = route === 'authenticated' || route === 'signOut';
|
|
49
|
+
if (isAuthenticatedRoute) {
|
|
47
50
|
return children ? <>{children}</> : null;
|
|
48
51
|
}
|
|
49
52
|
return (<react_native_safe_area_context_1.SafeAreaProvider>
|
|
@@ -64,8 +67,8 @@ Authenticator.ConfirmSignIn = Defaults_1.ConfirmSignIn;
|
|
|
64
67
|
Authenticator.ConfirmSignUp = Defaults_1.ConfirmSignUp;
|
|
65
68
|
Authenticator.ConfirmVerifyUser = Defaults_1.ConfirmVerifyUser;
|
|
66
69
|
Authenticator.ForceNewPassword = Defaults_1.ForceNewPassword;
|
|
67
|
-
Authenticator.
|
|
68
|
-
Authenticator.
|
|
70
|
+
Authenticator.ForgotPassword = Defaults_1.ForgotPassword;
|
|
71
|
+
Authenticator.SetupTotp = Defaults_1.SetupTotp;
|
|
69
72
|
Authenticator.SignIn = Defaults_1.SignIn;
|
|
70
73
|
Authenticator.SignUp = Defaults_1.SignUp;
|
|
71
74
|
Authenticator.VerifyUser = Defaults_1.VerifyUser;
|
|
@@ -5,7 +5,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const ui_1 = require("@aws-amplify/ui");
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const hooks_1 = require("../../hooks");
|
|
8
|
-
const COMPONENT_NAME = '
|
|
8
|
+
const COMPONENT_NAME = 'ForgotPassword';
|
|
9
9
|
const { getResetYourPasswordText, getSendCodeText, getSendingText, getBackToSignInText, } = ui_1.authenticatorTextUtil;
|
|
10
10
|
const ResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, validationErrors, ...rest }) => {
|
|
11
11
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = (0, hooks_1.useFieldValues)({
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ForgotPassword = void 0;
|
|
7
|
+
var ForgotPassword_1 = require("./ForgotPassword");
|
|
8
|
+
Object.defineProperty(exports, "ForgotPassword", { enumerable: true, get: function () { return __importDefault(ForgotPassword_1).default; } });
|
|
@@ -7,9 +7,9 @@ const primitives_1 = require("../../../primitives");
|
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const hooks_1 = require("../../hooks");
|
|
9
9
|
const styles_1 = require("./styles");
|
|
10
|
-
const COMPONENT_NAME = '
|
|
11
|
-
const { getBackToSignInText, getConfirmingText, getConfirmText,
|
|
12
|
-
const
|
|
10
|
+
const COMPONENT_NAME = 'SetupTotp';
|
|
11
|
+
const { getBackToSignInText, getConfirmingText, getConfirmText, getSetupTotpText, getSetupTotpInstructionsText, } = ui_1.authenticatorTextUtil;
|
|
12
|
+
const SetupTotp = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, validationErrors, ...rest }) => {
|
|
13
13
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = (0, hooks_1.useFieldValues)({
|
|
14
14
|
componentName: COMPONENT_NAME,
|
|
15
15
|
fields,
|
|
@@ -18,12 +18,12 @@ const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending,
|
|
|
18
18
|
handleSubmit,
|
|
19
19
|
validationErrors,
|
|
20
20
|
});
|
|
21
|
-
const headerText =
|
|
21
|
+
const headerText = getSetupTotpText();
|
|
22
22
|
const primaryButtonText = isPending ? getConfirmingText() : getConfirmText();
|
|
23
23
|
const secondaryButtonText = getBackToSignInText();
|
|
24
24
|
const body = (<>
|
|
25
25
|
<primitives_1.Label style={styles_1.styles.secretKeyText}>
|
|
26
|
-
{
|
|
26
|
+
{getSetupTotpInstructionsText()}
|
|
27
27
|
</primitives_1.Label>
|
|
28
28
|
<primitives_1.Label selectable style={styles_1.styles.secretKeyText}>
|
|
29
29
|
{totpSecretCode}
|
|
@@ -45,8 +45,8 @@ const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending,
|
|
|
45
45
|
]);
|
|
46
46
|
return (<common_1.DefaultContent {...rest} body={body} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
exports.default =
|
|
48
|
+
SetupTotp.Footer = common_1.DefaultFooter;
|
|
49
|
+
SetupTotp.FormFields = common_1.DefaultTextFormFields;
|
|
50
|
+
SetupTotp.Header = common_1.DefaultHeader;
|
|
51
|
+
SetupTotp.displayName = COMPONENT_NAME;
|
|
52
|
+
exports.default = SetupTotp;
|
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "
|
|
6
|
+
exports.SetupTotp = void 0;
|
|
7
|
+
var SetupTotp_1 = require("./SetupTotp");
|
|
8
|
+
Object.defineProperty(exports, "SetupTotp", { enumerable: true, get: function () { return __importDefault(SetupTotp_1).default; } });
|
|
@@ -6,7 +6,7 @@ const ui_1 = require("@aws-amplify/ui");
|
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const hooks_1 = require("../../hooks");
|
|
8
8
|
const COMPONENT_NAME = 'SignIn';
|
|
9
|
-
const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp,
|
|
9
|
+
const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, socialProviders, toFederatedSignIn, toForgotPassword, toSignUp, validationErrors, ...rest }) => {
|
|
10
10
|
const { getSignInTabText, getSignInText, getSignUpTabText, getForgotPasswordText, } = ui_1.authenticatorTextUtil;
|
|
11
11
|
const { disableFormSubmit: disabled, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = (0, hooks_1.useFieldValues)({
|
|
12
12
|
componentName: COMPONENT_NAME,
|
|
@@ -20,10 +20,11 @@ const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, to
|
|
|
20
20
|
const forgotPasswordText = getForgotPasswordText(true);
|
|
21
21
|
const signInText = getSignInText();
|
|
22
22
|
const signUpText = getSignUpTabText();
|
|
23
|
+
const body = socialProviders ? (<common_1.FederatedProviderButtons route="signIn" socialProviders={socialProviders} toFederatedSignIn={toFederatedSignIn}/>) : null;
|
|
23
24
|
const buttons = (0, react_1.useMemo)(() => {
|
|
24
25
|
const forgotPassword = {
|
|
25
26
|
children: forgotPasswordText,
|
|
26
|
-
onPress:
|
|
27
|
+
onPress: toForgotPassword,
|
|
27
28
|
};
|
|
28
29
|
return {
|
|
29
30
|
primary: { children: signInText, disabled, onPress: handleFormSubmit },
|
|
@@ -38,10 +39,10 @@ const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, to
|
|
|
38
39
|
hideSignUp,
|
|
39
40
|
signInText,
|
|
40
41
|
signUpText,
|
|
41
|
-
|
|
42
|
+
toForgotPassword,
|
|
42
43
|
toSignUp,
|
|
43
44
|
]);
|
|
44
|
-
return (<common_1.DefaultContent {...rest} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} validationErrors={fieldValidationErrors}/>);
|
|
45
|
+
return (<common_1.DefaultContent {...rest} body={body} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} validationErrors={fieldValidationErrors}/>);
|
|
45
46
|
};
|
|
46
47
|
SignIn.Footer = common_1.DefaultFooter;
|
|
47
48
|
SignIn.FormFields = common_1.DefaultTextFormFields;
|
|
@@ -7,7 +7,7 @@ const common_1 = require("../../common");
|
|
|
7
7
|
const hooks_1 = require("../../hooks");
|
|
8
8
|
const COMPONENT_NAME = 'SignUp';
|
|
9
9
|
const { getCreateAccountText, getCreatingAccountText, getSignInTabText, getSignUpTabText, } = ui_1.authenticatorTextUtil;
|
|
10
|
-
const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, toSignIn, validationErrors, ...rest }) => {
|
|
10
|
+
const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, socialProviders, toFederatedSignIn, toSignIn, validationErrors, ...rest }) => {
|
|
11
11
|
const { disableFormSubmit, fields: fieldsWithHandlers, fieldValidationErrors, handleFormSubmit, } = (0, hooks_1.useFieldValues)({
|
|
12
12
|
componentName: COMPONENT_NAME,
|
|
13
13
|
fields,
|
|
@@ -22,6 +22,7 @@ const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationE
|
|
|
22
22
|
? getCreatingAccountText()
|
|
23
23
|
: getCreateAccountText();
|
|
24
24
|
const secondaryButtonText = getSignInTabText();
|
|
25
|
+
const body = socialProviders ? (<common_1.FederatedProviderButtons route="signUp" socialProviders={socialProviders} toFederatedSignIn={toFederatedSignIn}/>) : null;
|
|
25
26
|
const buttons = (0, react_1.useMemo)(() => ({
|
|
26
27
|
primary: {
|
|
27
28
|
children: primaryButtonText,
|
|
@@ -39,7 +40,7 @@ const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationE
|
|
|
39
40
|
secondaryButtonText,
|
|
40
41
|
toSignIn,
|
|
41
42
|
]);
|
|
42
|
-
return (<common_1.DefaultContent {...rest} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
43
|
+
return (<common_1.DefaultContent {...rest} body={body} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText} isPending={isPending} validationErrors={fieldValidationErrors}/>);
|
|
43
44
|
};
|
|
44
45
|
SignUp.Footer = common_1.DefaultFooter;
|
|
45
46
|
SignUp.FormFields = common_1.DefaultTextFormFields;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VerifyUser = exports.SignUp = exports.SignIn = exports.
|
|
3
|
+
exports.VerifyUser = exports.SignUp = exports.SignIn = exports.SetupTotp = exports.ForgotPassword = exports.ForceNewPassword = exports.ConfirmVerifyUser = exports.ConfirmSignUp = exports.ConfirmSignIn = exports.ConfirmResetPassword = void 0;
|
|
4
4
|
var ConfirmResetPassword_1 = require("./ConfirmResetPassword");
|
|
5
5
|
Object.defineProperty(exports, "ConfirmResetPassword", { enumerable: true, get: function () { return ConfirmResetPassword_1.ConfirmResetPassword; } });
|
|
6
6
|
var ConfirmSignIn_1 = require("./ConfirmSignIn");
|
|
@@ -11,10 +11,10 @@ var ConfirmVerifyUser_1 = require("./ConfirmVerifyUser");
|
|
|
11
11
|
Object.defineProperty(exports, "ConfirmVerifyUser", { enumerable: true, get: function () { return ConfirmVerifyUser_1.ConfirmVerifyUser; } });
|
|
12
12
|
var ForceNewPassword_1 = require("./ForceNewPassword");
|
|
13
13
|
Object.defineProperty(exports, "ForceNewPassword", { enumerable: true, get: function () { return ForceNewPassword_1.ForceNewPassword; } });
|
|
14
|
-
var
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "
|
|
14
|
+
var ForgotPassword_1 = require("./ForgotPassword");
|
|
15
|
+
Object.defineProperty(exports, "ForgotPassword", { enumerable: true, get: function () { return ForgotPassword_1.ForgotPassword; } });
|
|
16
|
+
var SetupTotp_1 = require("./SetupTotp");
|
|
17
|
+
Object.defineProperty(exports, "SetupTotp", { enumerable: true, get: function () { return SetupTotp_1.SetupTotp; } });
|
|
18
18
|
var SignIn_1 = require("./SignIn");
|
|
19
19
|
Object.defineProperty(exports, "SignIn", { enumerable: true, get: function () { return SignIn_1.SignIn; } });
|
|
20
20
|
var SignUp_1 = require("./SignUp");
|