@aws-amplify/ui-react-native 1.2.22 → 1.2.24
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/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/lib/Authenticator/Authenticator.js +72 -0
- package/lib/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.js +43 -0
- package/lib/Authenticator/Defaults/ConfirmResetPassword/index.js +8 -0
- package/lib/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.js +42 -0
- package/lib/Authenticator/Defaults/ConfirmSignIn/index.js +8 -0
- package/lib/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.js +43 -0
- package/lib/Authenticator/Defaults/ConfirmSignUp/index.js +8 -0
- package/lib/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.js +42 -0
- package/lib/Authenticator/Defaults/ConfirmVerifyUser/index.js +8 -0
- package/lib/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.js +45 -0
- package/lib/Authenticator/Defaults/ForceNewPassword/index.js +8 -0
- package/lib/Authenticator/Defaults/ResetPassword/ResetPassword.js +42 -0
- package/lib/Authenticator/Defaults/ResetPassword/index.js +8 -0
- package/lib/Authenticator/Defaults/SetupTOTP/SetupTOTP.js +52 -0
- package/lib/Authenticator/Defaults/SetupTOTP/index.js +8 -0
- package/lib/Authenticator/Defaults/SetupTOTP/styles.js +8 -0
- package/lib/Authenticator/Defaults/SignIn/SignIn.js +50 -0
- package/lib/Authenticator/Defaults/SignIn/index.js +8 -0
- package/lib/Authenticator/Defaults/SignUp/SignUp.js +48 -0
- package/lib/Authenticator/Defaults/SignUp/index.js +8 -0
- package/lib/Authenticator/Defaults/VerifyUser/VerifyUser.js +33 -0
- package/lib/Authenticator/Defaults/VerifyUser/index.js +8 -0
- package/lib/Authenticator/Defaults/index.js +23 -0
- package/lib/Authenticator/Defaults/types.js +2 -0
- package/lib/Authenticator/common/DefaultContainer/DefaultContainer.js +37 -0
- package/lib/Authenticator/common/DefaultContainer/InnerContainer.js +15 -0
- package/lib/Authenticator/common/DefaultContainer/index.js +10 -0
- package/lib/Authenticator/common/DefaultContainer/styles.js +31 -0
- package/lib/Authenticator/common/DefaultContainer/types.js +2 -0
- package/lib/Authenticator/common/DefaultContent/DefaultContent.js +33 -0
- package/lib/Authenticator/common/DefaultContent/index.js +8 -0
- package/lib/Authenticator/common/DefaultContent/styles.js +54 -0
- package/lib/Authenticator/common/DefaultContent/types.js +2 -0
- package/lib/Authenticator/common/DefaultFooter/DefaultFooter.js +9 -0
- package/lib/Authenticator/common/DefaultFooter/index.js +8 -0
- package/lib/Authenticator/common/DefaultFooter/types.js +2 -0
- package/lib/Authenticator/common/DefaultFormFields/DefaultRadioFormFields.js +28 -0
- package/lib/Authenticator/common/DefaultFormFields/DefaultTextFormFields.js +21 -0
- package/lib/Authenticator/common/DefaultFormFields/Field.js +37 -0
- package/lib/Authenticator/common/DefaultFormFields/FieldErrors.js +17 -0
- package/lib/Authenticator/common/DefaultFormFields/index.js +10 -0
- package/lib/Authenticator/common/DefaultFormFields/types.js +2 -0
- package/lib/Authenticator/common/DefaultHeader/DefaultHeader.js +11 -0
- package/lib/Authenticator/common/DefaultHeader/index.js +8 -0
- package/lib/Authenticator/common/DefaultHeader/types.js +2 -0
- package/lib/Authenticator/common/FederatedProviderButton/FederatedProviderButton.js +18 -0
- package/lib/Authenticator/common/FederatedProviderButton/index.js +8 -0
- package/lib/Authenticator/common/FederatedProviderButton/styles.js +21 -0
- package/lib/Authenticator/common/FederatedProviderButton/types.js +2 -0
- package/lib/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.js +26 -0
- package/lib/Authenticator/common/FederatedProviderButtons/index.js +8 -0
- package/lib/Authenticator/common/FederatedProviderButtons/styles.js +8 -0
- package/lib/Authenticator/common/FederatedProviderButtons/types.js +2 -0
- package/lib/Authenticator/common/index.js +10 -0
- package/lib/Authenticator/hooks/index.js +5 -0
- package/lib/Authenticator/hooks/types.js +2 -0
- package/lib/Authenticator/hooks/useFieldValues/constants.js +11 -0
- package/lib/Authenticator/hooks/useFieldValues/index.js +10 -0
- package/lib/Authenticator/hooks/useFieldValues/types.js +2 -0
- package/lib/Authenticator/hooks/useFieldValues/useFieldValues.js +101 -0
- package/lib/Authenticator/hooks/useFieldValues/utils.js +139 -0
- package/lib/Authenticator/index.js +13 -0
- package/lib/Authenticator/types.js +2 -0
- package/lib/Authenticator/withAuthenticator.js +15 -0
- package/lib/InAppMessaging/components/BannerMessage/BannerMessage.js +20 -0
- package/lib/InAppMessaging/components/BannerMessage/index.js +8 -0
- package/lib/InAppMessaging/components/BannerMessage/styles.js +81 -0
- package/lib/InAppMessaging/components/BannerMessage/types.js +2 -0
- package/lib/InAppMessaging/components/CarouselMessage/CarouselMessage.js +25 -0
- package/lib/InAppMessaging/components/CarouselMessage/CarouselMessageItem.js +22 -0
- package/lib/InAppMessaging/components/CarouselMessage/index.js +8 -0
- package/lib/InAppMessaging/components/CarouselMessage/styles.js +103 -0
- package/lib/InAppMessaging/components/CarouselMessage/types.js +2 -0
- package/lib/InAppMessaging/components/FullScreenMessage/FullScreenMessage.js +22 -0
- package/lib/InAppMessaging/components/FullScreenMessage/index.js +8 -0
- package/lib/InAppMessaging/components/FullScreenMessage/styles.js +91 -0
- package/lib/InAppMessaging/components/FullScreenMessage/types.js +2 -0
- package/lib/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.js +32 -0
- package/lib/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +26 -0
- package/lib/InAppMessaging/components/InAppMessageDisplay/index.js +8 -0
- package/lib/InAppMessaging/components/InAppMessageDisplay/types.js +2 -0
- package/lib/InAppMessaging/components/MessageLayout/MessageLayout.js +38 -0
- package/lib/InAppMessaging/components/MessageLayout/index.js +8 -0
- package/lib/InAppMessaging/components/MessageLayout/types.js +2 -0
- package/lib/InAppMessaging/components/MessageWrapper/MessageWrapper.js +24 -0
- package/lib/InAppMessaging/components/MessageWrapper/index.js +8 -0
- package/lib/InAppMessaging/components/MessageWrapper/styles.js +8 -0
- package/lib/InAppMessaging/components/MessageWrapper/types.js +2 -0
- package/lib/InAppMessaging/components/ModalMessage/ModalMessage.js +22 -0
- package/lib/InAppMessaging/components/ModalMessage/index.js +8 -0
- package/lib/InAppMessaging/components/ModalMessage/styles.js +104 -0
- package/lib/InAppMessaging/components/ModalMessage/types.js +2 -0
- package/lib/InAppMessaging/components/index.js +7 -0
- package/lib/InAppMessaging/components/withInAppMessaging/index.js +8 -0
- package/lib/InAppMessaging/components/withInAppMessaging/withInAppMessaging.js +15 -0
- package/lib/InAppMessaging/constants.js +48 -0
- package/lib/InAppMessaging/hooks/index.js +7 -0
- package/lib/InAppMessaging/hooks/useMessageImage/constants.js +21 -0
- package/lib/InAppMessaging/hooks/useMessageImage/index.js +8 -0
- package/lib/InAppMessaging/hooks/useMessageImage/types.js +9 -0
- package/lib/InAppMessaging/hooks/useMessageImage/useMessageImage.js +53 -0
- package/lib/InAppMessaging/hooks/useMessageImage/utils.js +61 -0
- package/lib/InAppMessaging/hooks/useMessageProps/index.js +8 -0
- package/lib/InAppMessaging/hooks/useMessageProps/types.js +2 -0
- package/lib/InAppMessaging/hooks/useMessageProps/useMessageProps.js +52 -0
- package/lib/InAppMessaging/hooks/useMessageProps/utils.js +201 -0
- package/lib/InAppMessaging/index.js +9 -0
- package/lib/assets/icons/amazonLogo.png +0 -0
- package/lib/assets/icons/amazonLogo@2x.png +0 -0
- package/lib/assets/icons/amazonLogo@3x.png +0 -0
- package/lib/assets/icons/appleLogo.png +0 -0
- package/lib/assets/icons/appleLogo@2x.png +0 -0
- package/lib/assets/icons/appleLogo@3x.png +0 -0
- package/lib/assets/icons/checkboxFilled.png +0 -0
- package/lib/assets/icons/checkboxFilled@2x.png +0 -0
- package/lib/assets/icons/checkboxFilled@3x.png +0 -0
- package/lib/assets/icons/checkboxOutline.png +0 -0
- package/lib/assets/icons/checkboxOutline@2x.png +0 -0
- package/lib/assets/icons/checkboxOutline@3x.png +0 -0
- package/lib/assets/icons/close.png +0 -0
- package/lib/assets/icons/close@2x.png +0 -0
- package/lib/assets/icons/close@3x.png +0 -0
- package/lib/assets/icons/copy.png +0 -0
- package/lib/assets/icons/copy@2x.png +0 -0
- package/lib/assets/icons/copy@3x.png +0 -0
- package/lib/assets/icons/error.png +0 -0
- package/lib/assets/icons/error@2x.png +0 -0
- package/lib/assets/icons/error@3x.png +0 -0
- package/lib/assets/icons/facebookLogo.png +0 -0
- package/lib/assets/icons/facebookLogo@2x.png +0 -0
- package/lib/assets/icons/facebookLogo@3x.png +0 -0
- package/lib/assets/icons/googleLogo.png +0 -0
- package/lib/assets/icons/googleLogo@2x.png +0 -0
- package/lib/assets/icons/googleLogo@3x.png +0 -0
- package/lib/assets/icons/index.js +16 -0
- package/lib/assets/icons/index.ts +17 -0
- package/lib/assets/icons/visibilityOff.png +0 -0
- package/lib/assets/icons/visibilityOff@2x.png +0 -0
- package/lib/assets/icons/visibilityOff@3x.png +0 -0
- package/lib/assets/icons/visibilityOn.png +0 -0
- package/lib/assets/icons/visibilityOn@2x.png +0 -0
- package/lib/assets/icons/visibilityOn@3x.png +0 -0
- package/lib/assets/index.js +8 -0
- package/lib/hooks/index.js +9 -0
- package/lib/hooks/useDeprecationWarning/index.js +8 -0
- package/lib/hooks/useDeprecationWarning/useDeprecationWarning.js +13 -0
- package/lib/hooks/useDeviceOrientation/index.js +8 -0
- package/lib/hooks/useDeviceOrientation/useDeviceOrientation.js +37 -0
- package/lib/hooks/usePressableContainerStyles/index.js +5 -0
- package/lib/hooks/usePressableContainerStyles/usePressableContainerStyles.js +19 -0
- package/lib/index.js +14 -0
- package/lib/primitives/Button/Button.js +31 -0
- package/lib/primitives/Button/index.js +8 -0
- package/lib/primitives/Button/styles.js +55 -0
- package/lib/primitives/Button/types.js +2 -0
- package/lib/primitives/Carousel/Carousel.js +63 -0
- package/lib/primitives/Carousel/CarouselPageIndicator.js +14 -0
- package/lib/primitives/Carousel/constants.js +21 -0
- package/lib/primitives/Carousel/index.js +10 -0
- package/lib/primitives/Carousel/styles.js +14 -0
- package/lib/primitives/Carousel/types.js +2 -0
- package/lib/primitives/Checkbox/Checkbox.js +28 -0
- package/lib/primitives/Checkbox/index.js +8 -0
- package/lib/primitives/Checkbox/styles.js +28 -0
- package/lib/primitives/Checkbox/types.js +2 -0
- package/lib/primitives/Divider/Divider.js +22 -0
- package/lib/primitives/Divider/index.js +8 -0
- package/lib/primitives/Divider/styles.js +28 -0
- package/lib/primitives/Divider/types.js +2 -0
- package/lib/primitives/ErrorMessage/ErrorMessage.js +22 -0
- package/lib/primitives/ErrorMessage/index.js +8 -0
- package/lib/primitives/ErrorMessage/styles.js +30 -0
- package/lib/primitives/ErrorMessage/types.js +2 -0
- package/lib/primitives/Heading/Heading.js +15 -0
- package/lib/primitives/Heading/index.js +8 -0
- package/lib/primitives/Heading/styles.js +51 -0
- package/lib/primitives/Heading/types.js +2 -0
- package/lib/primitives/Icon/Icon.js +21 -0
- package/lib/primitives/Icon/constants.js +10 -0
- package/lib/primitives/Icon/index.js +10 -0
- package/lib/primitives/Icon/styles.js +34 -0
- package/lib/primitives/Icon/types.js +2 -0
- package/lib/primitives/IconButton/IconButton.js +26 -0
- package/lib/primitives/IconButton/index.js +8 -0
- package/lib/primitives/IconButton/styles.js +21 -0
- package/lib/primitives/IconButton/types.js +2 -0
- package/lib/primitives/Label/Label.js +16 -0
- package/lib/primitives/Label/index.js +8 -0
- package/lib/primitives/Label/styles.js +45 -0
- package/lib/primitives/Label/types.js +2 -0
- package/lib/primitives/Label/utils.js +25 -0
- package/lib/primitives/PasswordField/PasswordField.js +24 -0
- package/lib/primitives/PasswordField/index.js +8 -0
- package/lib/primitives/PasswordField/styles.js +17 -0
- package/lib/primitives/PasswordField/types.js +2 -0
- package/lib/primitives/PhoneNumberField/PhoneNumberField.js +13 -0
- package/lib/primitives/PhoneNumberField/index.js +8 -0
- package/lib/primitives/PhoneNumberField/styles.js +22 -0
- package/lib/primitives/PhoneNumberField/types.js +2 -0
- package/lib/primitives/Radio/Radio.js +46 -0
- package/lib/primitives/Radio/getRadioDimensions.js +43 -0
- package/lib/primitives/Radio/index.js +8 -0
- package/lib/primitives/Radio/styles.js +68 -0
- package/lib/primitives/Radio/types.js +2 -0
- package/lib/primitives/RadioGroup/RadioGroup.js +55 -0
- package/lib/primitives/RadioGroup/index.js +8 -0
- package/lib/primitives/RadioGroup/styles.js +20 -0
- package/lib/primitives/RadioGroup/types.js +2 -0
- package/lib/primitives/Tabs/Tab.js +27 -0
- package/lib/primitives/Tabs/Tabs.js +29 -0
- package/lib/primitives/Tabs/index.js +10 -0
- package/lib/primitives/Tabs/styles.js +58 -0
- package/lib/primitives/Tabs/types.js +2 -0
- package/lib/primitives/TextField/TextField.js +31 -0
- package/lib/primitives/TextField/index.js +8 -0
- package/lib/primitives/TextField/styles.js +46 -0
- package/lib/primitives/TextField/types.js +2 -0
- package/lib/primitives/index.js +18 -0
- package/lib/theme/ThemeContext.js +9 -0
- package/lib/theme/ThemeProvider.js +12 -0
- package/lib/theme/createTheme.js +113 -0
- package/lib/theme/defaultTheme.js +11 -0
- package/lib/theme/index.js +12 -0
- package/lib/theme/types.js +2 -0
- package/lib/theme/useTheme.js +11 -0
- package/lib/utils/font.js +8 -0
- package/lib/utils/index.js +10 -0
- package/lib/utils/platform.js +21 -0
- package/lib/version.js +4 -0
- package/package.json +20 -11
- package/src/version.ts +1 -1
- package/.eslintrc.js +0 -12
- package/.lintstagedrc.js +0 -6
- package/.turbo/turbo-build.log +0 -3
- package/CHANGELOG.md +0 -332
- package/babel.config.js +0 -3
- package/dist/assets/index.ts +0 -1
- package/jest.config.js +0 -22
- package/jest.setup.js +0 -3
- package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/ConfirmResetPassword.spec.tsx +0 -89
- package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/__snapshots__/ConfirmResetPassword.spec.tsx.snap +0 -1090
- package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/ConfirmSignIn.spec.tsx +0 -78
- package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/__snapshots__/ConfirmSignIn.spec.tsx.snap +0 -512
- package/src/Authenticator/Defaults/ConfirmSignUp/__tests__/ConfirmSignUp.spec.tsx +0 -64
- package/src/Authenticator/Defaults/ConfirmSignUp/__tests__/__snapshots__/ConfirmSignUp.spec.tsx.snap +0 -528
- package/src/Authenticator/Defaults/ConfirmVerifyUser/__tests__/ConfirmVerifyUser.spec.tsx +0 -71
- package/src/Authenticator/Defaults/ConfirmVerifyUser/__tests__/__snapshots__/ConfirmVerifyUser.spec.tsx.snap +0 -492
- package/src/Authenticator/Defaults/ForceNewPassword/__tests__/ForceNewPassword.spec.tsx +0 -79
- package/src/Authenticator/Defaults/ForceNewPassword/__tests__/__snapshots__/ForceNewPassword.spec.tsx.snap +0 -896
- package/src/Authenticator/Defaults/ResetPassword/__tests__/ResetPassword.spec.tsx +0 -78
- package/src/Authenticator/Defaults/ResetPassword/__tests__/__snapshots__/ResetPassword.spec.tsx.snap +0 -512
- package/src/Authenticator/Defaults/SetupTOTP/__tests__/SetupTOTP.spec.tsx +0 -85
- package/src/Authenticator/Defaults/SetupTOTP/__tests__/__snapshots__/SetupTOTP.spec.tsx.snap +0 -602
- package/src/Authenticator/Defaults/SignIn/__tests__/SignIn.spec.tsx +0 -67
- package/src/Authenticator/Defaults/SignIn/__tests__/__snapshots__/SignIn.spec.tsx.snap +0 -1281
- package/src/Authenticator/Defaults/SignUp/__tests__/SignUp.spec.tsx +0 -102
- package/src/Authenticator/Defaults/SignUp/__tests__/__snapshots__/SignUp.spec.tsx.snap +0 -3122
- package/src/Authenticator/Defaults/VerifyUser/__tests__/VerifyUser.spec.tsx +0 -107
- package/src/Authenticator/Defaults/VerifyUser/__tests__/__snapshots__/VerifyUser.spec.tsx.snap +0 -692
- package/src/Authenticator/__tests__/Authenticator.spec.tsx +0 -131
- package/src/Authenticator/__tests__/__snapshots__/Authenticator.spec.tsx.snap +0 -90
- package/src/Authenticator/__tests__/__snapshots__/withAuthenticator.spec.tsx.snap +0 -68
- package/src/Authenticator/__tests__/withAuthenticator.spec.tsx +0 -73
- package/src/Authenticator/common/DefaultContainer/__tests__/DefaultContainer.spec.tsx +0 -19
- package/src/Authenticator/common/DefaultContainer/__tests__/__snapshots__/DefaultContainer.spec.tsx.snap +0 -83
- package/src/Authenticator/common/DefaultFooter/__tests__/DefaultFooter.spec.tsx +0 -26
- package/src/Authenticator/common/DefaultFooter/__tests__/__snapshots__/DefaultFooter.spec.tsx.snap +0 -40
- package/src/Authenticator/common/DefaultFormFields/__tests__/DefaultFormFields.spec.tsx +0 -15
- package/src/Authenticator/common/DefaultFormFields/__tests__/FieldErrors.spec.tsx +0 -29
- package/src/Authenticator/common/DefaultFormFields/__tests__/__snapshots__/DefaultFormFields.spec.tsx.snap +0 -3
- package/src/Authenticator/common/DefaultFormFields/__tests__/__snapshots__/FieldErrors.spec.tsx.snap +0 -32
- package/src/Authenticator/common/DefaultHeader/__tests__/DefaultHeader.spec.tsx +0 -23
- package/src/Authenticator/common/DefaultHeader/__tests__/__snapshots__/DefaultHeader.spec.tsx.snap +0 -24
- package/src/Authenticator/common/FederatedProviderButton/__tests__/FederatedProviderButton.spec.tsx +0 -67
- package/src/Authenticator/common/FederatedProviderButton/__tests__/__snapshots__/FederatedProviderButton.spec.tsx.snap +0 -185
- package/src/Authenticator/common/FederatedProviderButtons/__tests__/FederatedProviderButtons.spec.tsx +0 -55
- package/src/Authenticator/common/FederatedProviderButtons/__tests__/__snapshots__/FederatedProviderButtons.spec.tsx.snap +0 -167
- package/src/Authenticator/hooks/useFieldValues/__tests__/useFieldValues.spec.ts +0 -399
- package/src/Authenticator/hooks/useFieldValues/__tests__/utils.spec.ts +0 -282
- package/src/InAppMessaging/components/BannerMessage/__tests__/BannerMessage.spec.tsx +0 -151
- package/src/InAppMessaging/components/BannerMessage/__tests__/__snapshots__/BannerMessage.spec.tsx.snap +0 -618
- package/src/InAppMessaging/components/CarouselMessage/__tests__/CarouselMessage.spec.tsx +0 -92
- package/src/InAppMessaging/components/CarouselMessage/__tests__/CarouselMessageItem.spec.tsx +0 -50
- package/src/InAppMessaging/components/CarouselMessage/__tests__/__snapshots__/CarouselMessage.spec.tsx.snap +0 -124
- package/src/InAppMessaging/components/CarouselMessage/__tests__/__snapshots__/CarouselMessageItem.spec.tsx.snap +0 -248
- package/src/InAppMessaging/components/FullScreenMessage/__tests__/FullScreenMessage.spec.tsx +0 -53
- package/src/InAppMessaging/components/FullScreenMessage/__tests__/__snapshots__/FullScreenMessage.spec.tsx.snap +0 -238
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/InAppMessageDisplay.spec.tsx +0 -34
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/__snapshots__/InAppMessageDisplay.spec.tsx.snap +0 -9
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/handleMessageLinkAction.spec.ts +0 -51
- package/src/InAppMessaging/components/MessageWrapper/__tests__/MessageWrapper.spec.tsx +0 -19
- package/src/InAppMessaging/components/MessageWrapper/__tests__/__snapshots__/MessageWrapper.spec.tsx.snap +0 -35
- package/src/InAppMessaging/components/ModalMessage/__tests__/ModalMessage.spec.tsx +0 -169
- package/src/InAppMessaging/components/ModalMessage/__tests__/__snapshots__/ModalMessage.spec.tsx.snap +0 -727
- package/src/InAppMessaging/components/withInAppMessaging/__tests__/__snapshots__/withInAppMessaging.spec.tsx.snap +0 -3
- package/src/InAppMessaging/components/withInAppMessaging/__tests__/withInAppMessaging.spec.tsx +0 -15
- package/src/InAppMessaging/hooks/useMessageImage/__tests__/useMessageImage.spec.ts +0 -141
- package/src/InAppMessaging/hooks/useMessageImage/__tests__/utils.spec.ts +0 -107
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/__snapshots__/utils.spec.ts.snap +0 -223
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/useMessageProps.spec.ts +0 -162
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/utils.spec.ts +0 -355
- package/src/__mocks__/@react-native-async-storage/async-storage.ts +0 -2
- package/src/__mocks__/@react-native-community/netinfo.ts +0 -3
- package/src/__mocks__/react-native-safe-area-context.ts +0 -9
- package/src/__tests__/__snapshots__/index.spec.ts.snap +0 -26
- package/src/__tests__/index.spec.ts +0 -8
- package/src/hooks/useDeprecationWarning/__tests__/useDeprecationWarning.spec.ts +0 -42
- package/src/hooks/useDeviceOrientation/__tests__/useDeviceOrientation.spec.ts +0 -89
- package/src/hooks/usePressableContainerStyles/__tests__/usePressableContainerStyles.spec.ts +0 -68
- package/src/primitives/Button/__tests__/Button.spec.tsx +0 -92
- package/src/primitives/Button/__tests__/__snapshots__/Button.spec.tsx.snap +0 -143
- package/src/primitives/Carousel/__tests__/Carousel.spec.tsx +0 -174
- package/src/primitives/Carousel/__tests__/CarouselPageIndicator.spec.tsx +0 -73
- package/src/primitives/Carousel/__tests__/__snapshots__/Carousel.spec.tsx.snap +0 -310
- package/src/primitives/Carousel/__tests__/__snapshots__/CarouselPageIndicator.spec.tsx.snap +0 -191
- package/src/primitives/Checkbox/__tests__/Checkbox.spec.tsx +0 -150
- package/src/primitives/Checkbox/__tests__/__snapshots__/Checkbox.spec.tsx.snap +0 -527
- package/src/primitives/Divider/__tests__/Divider.spec.tsx +0 -50
- package/src/primitives/Divider/__tests__/__snapshots__/Divider.spec.tsx.snap +0 -165
- package/src/primitives/ErrorMessage/__tests__/ErrorMessage.spec.tsx +0 -60
- package/src/primitives/ErrorMessage/__tests__/__snapshots__/ErrorMessage.spec.tsx.snap +0 -123
- package/src/primitives/Heading/__tests__/Heading.spec.tsx +0 -73
- package/src/primitives/Heading/__tests__/__snapshots__/Heading.spec.tsx.snap +0 -171
- package/src/primitives/Icon/__tests__/Icon.spec.tsx +0 -100
- package/src/primitives/Icon/__tests__/__snapshots__/Icon.spec.tsx.snap +0 -139
- package/src/primitives/IconButton/__tests__/IconButton.spec.tsx +0 -71
- package/src/primitives/IconButton/__tests__/__snapshots__/IconButton.spec.tsx.snap +0 -192
- package/src/primitives/Label/__tests__/Label.spec.tsx +0 -75
- package/src/primitives/Label/__tests__/__snapshots__/Label.spec.tsx.snap +0 -91
- package/src/primitives/PasswordField/__tests__/PasswordField.spec.tsx +0 -110
- package/src/primitives/PasswordField/__tests__/__snapshots__/PasswordField.spec.tsx.snap +0 -625
- package/src/primitives/PhoneNumberField/__tests__/PhoneNumberField.spec.tsx +0 -53
- package/src/primitives/PhoneNumberField/__tests__/__snapshots__/PhoneNumberField.spec.tsx.snap +0 -188
- package/src/primitives/Radio/__tests__/Radio.spec.tsx +0 -166
- package/src/primitives/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +0 -678
- package/src/primitives/RadioGroup/__tests__/RadioGroup.spec.tsx +0 -183
- package/src/primitives/RadioGroup/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +0 -1789
- package/src/primitives/Tabs/__tests__/Tab.spec.tsx +0 -75
- package/src/primitives/Tabs/__tests__/Tabs.spec.tsx +0 -81
- package/src/primitives/Tabs/__tests__/__snapshots__/Tab.spec.tsx.snap +0 -278
- package/src/primitives/Tabs/__tests__/__snapshots__/Tabs.spec.tsx.snap +0 -163
- package/src/primitives/TextField/__tests__/TextField.spec.tsx +0 -202
- package/src/primitives/TextField/__tests__/__snapshots__/TextField.spec.tsx.snap +0 -507
- package/src/theme/__tests__/ThemeProvider.spec.tsx +0 -23
- package/src/theme/__tests__/__snapshots__/useTheme.spec.tsx.snap +0 -226
- package/src/theme/__tests__/createTheme.spec.ts +0 -244
- package/src/theme/__tests__/useTheme.spec.tsx +0 -51
- package/tsconfig.dist.json +0 -4
- package/tsconfig.json +0 -9
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const aws_amplify_1 = require("aws-amplify");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const logger = new aws_amplify_1.Logger('Authenticator');
|
|
7
|
+
function useFieldValues({ componentName, fields = [], handleBlur, handleChange, handleSubmit, validationErrors, }) {
|
|
8
|
+
const [values, setValues] = (0, react_1.useState)({});
|
|
9
|
+
const [touched, setTouched] = (0, react_1.useState)({});
|
|
10
|
+
const [fieldValidationErrors, setFieldValidationErrors] = (0, react_1.useState)({});
|
|
11
|
+
const isRadioFieldComponent = componentName === 'VerifyUser';
|
|
12
|
+
const sanitizedFields = (0, react_1.useMemo)(() => {
|
|
13
|
+
if (!Array.isArray(fields)) {
|
|
14
|
+
logger.warn(`Invalid fields type of ${typeof fields} passed to ${componentName}. fields must be of type array.`);
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
if (isRadioFieldComponent) {
|
|
18
|
+
return (0, utils_1.getSanitizedRadioFields)(fields, componentName);
|
|
19
|
+
}
|
|
20
|
+
return (0, utils_1.getSanitizedTextFields)(fields, componentName);
|
|
21
|
+
}, [componentName, fields, isRadioFieldComponent]);
|
|
22
|
+
const fieldsWithHandlers = sanitizedFields.map((field) => {
|
|
23
|
+
if ((0, utils_1.isRadioFieldOptions)(field)) {
|
|
24
|
+
const onChange = (value) => {
|
|
25
|
+
// call `onChange` passed as radio `field` option
|
|
26
|
+
field.onChange?.(value);
|
|
27
|
+
// set `name` as value of 'unverifiedAttr'
|
|
28
|
+
setValues({ unverifiedAttr: value });
|
|
29
|
+
};
|
|
30
|
+
return { ...field, onChange };
|
|
31
|
+
}
|
|
32
|
+
const { name, label, labelHidden, ...rest } = field;
|
|
33
|
+
const onBlur = (event) => {
|
|
34
|
+
setTouched({ ...touched, [name]: true });
|
|
35
|
+
// call `onBlur` passed as text `field` option
|
|
36
|
+
field.onBlur?.(event);
|
|
37
|
+
// call machine blur handler
|
|
38
|
+
handleBlur({ name, value: values[name] });
|
|
39
|
+
setFieldValidationErrors({
|
|
40
|
+
...fieldValidationErrors,
|
|
41
|
+
[name]: (0, utils_1.runFieldValidation)(field, values[name], validationErrors),
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const onChangeText = (value) => {
|
|
45
|
+
// call `onChangeText` passed as text `field` option
|
|
46
|
+
field.onChangeText?.(value);
|
|
47
|
+
// call machine change handler
|
|
48
|
+
handleChange({ name, value });
|
|
49
|
+
if (touched[name]) {
|
|
50
|
+
setFieldValidationErrors({
|
|
51
|
+
...fieldValidationErrors,
|
|
52
|
+
[name]: (0, utils_1.runFieldValidation)(field, value, validationErrors),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
setValues({ ...values, [name]: value });
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
...rest,
|
|
59
|
+
label: labelHidden ? undefined : label,
|
|
60
|
+
onBlur,
|
|
61
|
+
onChangeText,
|
|
62
|
+
name,
|
|
63
|
+
value: values[name],
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const disableFormSubmit = isRadioFieldComponent
|
|
67
|
+
? !values.unverifiedAttr
|
|
68
|
+
: fieldsWithHandlers.some(({ required, value }) => {
|
|
69
|
+
if (!required) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (value) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
});
|
|
77
|
+
const handleFormSubmit = () => {
|
|
78
|
+
const submitValue = isRadioFieldComponent
|
|
79
|
+
? values
|
|
80
|
+
: fieldsWithHandlers.reduce((acc, { name, value = '', type }) => {
|
|
81
|
+
/*
|
|
82
|
+
For phone numbers pass the first 3 charactes from value as dialCode until we support a dialCode picker
|
|
83
|
+
*/
|
|
84
|
+
return type === 'phone'
|
|
85
|
+
? {
|
|
86
|
+
...acc,
|
|
87
|
+
country_code: value?.substring(0, 3),
|
|
88
|
+
[name]: value?.substring(3, value.length),
|
|
89
|
+
}
|
|
90
|
+
: { ...acc, [name]: value };
|
|
91
|
+
}, {});
|
|
92
|
+
handleSubmit?.(submitValue);
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
fields: fieldsWithHandlers,
|
|
96
|
+
disableFormSubmit,
|
|
97
|
+
fieldValidationErrors: { ...fieldValidationErrors, ...validationErrors },
|
|
98
|
+
handleFormSubmit,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
exports.default = useFieldValues;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runFieldValidation = exports.getRouteTypedFields = exports.getTypedFields = exports.getTypedField = exports.getSanitizedTextFields = exports.getSanitizedRadioFields = exports.isRadioFieldOptions = void 0;
|
|
4
|
+
const aws_amplify_1 = require("aws-amplify");
|
|
5
|
+
const ui_1 = require("@aws-amplify/ui");
|
|
6
|
+
const ui_react_core_1 = require("@aws-amplify/ui-react-core");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const logger = new aws_amplify_1.Logger('Authenticator');
|
|
9
|
+
const { getInvalidEmailText, getRequiredFieldText } = ui_1.authenticatorTextUtil;
|
|
10
|
+
const isRadioFieldOptions = (field) => field?.type === 'radio';
|
|
11
|
+
exports.isRadioFieldOptions = isRadioFieldOptions;
|
|
12
|
+
const getSanitizedRadioFields = (fields, componentName) => {
|
|
13
|
+
const values = {};
|
|
14
|
+
return fields.filter((field) => {
|
|
15
|
+
if (!(0, exports.isRadioFieldOptions)(field)) {
|
|
16
|
+
logger.warn(`${componentName} component does not support text fields. field with type ${field.type} has been ignored.`);
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const { name, value } = field;
|
|
20
|
+
if (!value) {
|
|
21
|
+
logger.warn('Each radio field must have a value. field has been ignored.');
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (values[value]) {
|
|
25
|
+
logger.warn(`Each radio field value must be unique. field with duplicate value of ${value} has been ignored.`);
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (!(0, ui_1.isUnverifiedContactMethodType)(name)) {
|
|
29
|
+
logger.warn(`field with name '${name}' has been ignored. Supported values are: ${Object.values(ui_1.UnverifiedContactMethodType)}.`);
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// add `value` key to `values`
|
|
33
|
+
values[value] = true;
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.getSanitizedRadioFields = getSanitizedRadioFields;
|
|
38
|
+
const getSanitizedTextFields = (fields, componentName) => {
|
|
39
|
+
const names = {};
|
|
40
|
+
return fields.filter((field) => {
|
|
41
|
+
if ((0, exports.isRadioFieldOptions)(field)) {
|
|
42
|
+
logger.warn(`${componentName} component does not support radio fields. field has been ignored.`);
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const { name } = field;
|
|
46
|
+
if (!name) {
|
|
47
|
+
logger.warn('Each field must have a name. field has been ignored.');
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (names[name]) {
|
|
51
|
+
logger.warn(`Each field name must be unique. field with duplicate name of ${name} has been ignored.`);
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
names[name] = true;
|
|
55
|
+
return true;
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
exports.getSanitizedTextFields = getSanitizedTextFields;
|
|
59
|
+
// typed fields utils
|
|
60
|
+
const isKeyAllowed = (key) => constants_1.KEY_ALLOW_LIST.some((allowedKey) => allowedKey === key);
|
|
61
|
+
const isValidMachineFieldType = (type) => type === 'password' || type === 'tel' || type == 'email';
|
|
62
|
+
const getFieldType = (type) => {
|
|
63
|
+
if (isValidMachineFieldType(type)) {
|
|
64
|
+
return type === 'tel' ? 'phone' : type;
|
|
65
|
+
}
|
|
66
|
+
return 'default';
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Translate machine fields to typed fields
|
|
70
|
+
*
|
|
71
|
+
* @param {AuthenticatorLegacyField} field machine field option object
|
|
72
|
+
* @returns {TypedField} UI field props object
|
|
73
|
+
*/
|
|
74
|
+
const getTypedField = ({ type: machineFieldType, name, ...field }) => {
|
|
75
|
+
const type = getFieldType(machineFieldType);
|
|
76
|
+
const testID = `authenticator__text-field__input-${name}`;
|
|
77
|
+
return Object.entries(field).reduce((acc, [key, value]) => {
|
|
78
|
+
// early return if key is not allowed
|
|
79
|
+
if (!isKeyAllowed(key)) {
|
|
80
|
+
return acc;
|
|
81
|
+
}
|
|
82
|
+
// map to `required` prop
|
|
83
|
+
if (key === 'isRequired' || key === 'required') {
|
|
84
|
+
// `TypedField` props expects `required` key
|
|
85
|
+
return { ...acc, required: value, testID };
|
|
86
|
+
}
|
|
87
|
+
return { ...acc, [key]: value, testID };
|
|
88
|
+
},
|
|
89
|
+
// initialize `acc` with field `name` and `type`
|
|
90
|
+
{ name, type });
|
|
91
|
+
};
|
|
92
|
+
exports.getTypedField = getTypedField;
|
|
93
|
+
/**
|
|
94
|
+
* @param {AuthenticatorLegacyField[]} fields machine field options array
|
|
95
|
+
* @returns {TypedField[]} UI field props array
|
|
96
|
+
*/
|
|
97
|
+
const getTypedFields = (fields) => fields?.map(exports.getTypedField);
|
|
98
|
+
exports.getTypedFields = getTypedFields;
|
|
99
|
+
function getRouteTypedFields({ fields, route, }) {
|
|
100
|
+
const isComponentRoute = (0, ui_react_core_1.isAuthenticatorComponentRouteKey)(route);
|
|
101
|
+
if (!isComponentRoute) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
// `VerifyUser` does not require additional updates to the shape of `fields`
|
|
105
|
+
const isVerifyUserRoute = route === 'verifyUser';
|
|
106
|
+
const radioFields = fields;
|
|
107
|
+
return isVerifyUserRoute ? radioFields : (0, exports.getTypedFields)(fields);
|
|
108
|
+
}
|
|
109
|
+
exports.getRouteTypedFields = getRouteTypedFields;
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* @param {TextFieldOptionsType} field text field type
|
|
113
|
+
* @param {string | undefined} value text field value
|
|
114
|
+
* @param {string[]} stateValidations validation errors array from state machine
|
|
115
|
+
* @returns {string[]} field errors array
|
|
116
|
+
*/
|
|
117
|
+
const runFieldValidation = (field, value, stateValidations) => {
|
|
118
|
+
const fieldErrors = [];
|
|
119
|
+
if (field.required && !value) {
|
|
120
|
+
fieldErrors.push(getRequiredFieldText());
|
|
121
|
+
}
|
|
122
|
+
if (field.type === 'email') {
|
|
123
|
+
if (!(0, ui_1.isValidEmail)(value)) {
|
|
124
|
+
fieldErrors.push(getInvalidEmailText());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// add state machine validation errors, if any
|
|
128
|
+
const stateFieldValidation = stateValidations?.[field.name];
|
|
129
|
+
if (stateFieldValidation) {
|
|
130
|
+
if ((0, ui_1.isString)(stateFieldValidation)) {
|
|
131
|
+
fieldErrors.push(stateFieldValidation);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return fieldErrors.concat(stateFieldValidation);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return fieldErrors;
|
|
138
|
+
};
|
|
139
|
+
exports.runFieldValidation = runFieldValidation;
|
|
@@ -0,0 +1,13 @@
|
|
|
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.useAuthenticator = exports.withAuthenticator = exports.Authenticator = void 0;
|
|
7
|
+
var Authenticator_1 = require("./Authenticator");
|
|
8
|
+
Object.defineProperty(exports, "Authenticator", { enumerable: true, get: function () { return __importDefault(Authenticator_1).default; } });
|
|
9
|
+
var withAuthenticator_1 = require("./withAuthenticator");
|
|
10
|
+
Object.defineProperty(exports, "withAuthenticator", { enumerable: true, get: function () { return __importDefault(withAuthenticator_1).default; } });
|
|
11
|
+
// re-export shared `Authenticator` exports
|
|
12
|
+
var ui_react_core_1 = require("@aws-amplify/ui-react-core");
|
|
13
|
+
Object.defineProperty(exports, "useAuthenticator", { enumerable: true, get: function () { return ui_react_core_1.useAuthenticator; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const Authenticator_1 = tslib_1.__importDefault(require("./Authenticator"));
|
|
6
|
+
function withAuthenticator(Component, options = {}) {
|
|
7
|
+
return function WrappedWithAuthenticator(props) {
|
|
8
|
+
return (<Authenticator_1.default.Provider>
|
|
9
|
+
<Authenticator_1.default {...options}>
|
|
10
|
+
<Component {...props}/>
|
|
11
|
+
</Authenticator_1.default>
|
|
12
|
+
</Authenticator_1.default.Provider>);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.default = withAuthenticator;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const hooks_1 = require("../../hooks");
|
|
6
|
+
const MessageWrapper_1 = require("../MessageWrapper");
|
|
7
|
+
const MessageLayout_1 = require("../MessageLayout");
|
|
8
|
+
const styles_1 = require("./styles");
|
|
9
|
+
function BannerMessage({ position = 'top', ...props }) {
|
|
10
|
+
const messageProps = (0, hooks_1.useMessageProps)(props, (imageDimensions) => (0, styles_1.getStyles)(imageDimensions, { position: { ...styles_1.positionStyle[position] } }));
|
|
11
|
+
const { shouldRenderMessage, styles } = messageProps;
|
|
12
|
+
if (!shouldRenderMessage) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const { wrapper, ...messageStyles } = styles;
|
|
16
|
+
return (<MessageWrapper_1.MessageWrapper style={wrapper}>
|
|
17
|
+
<MessageLayout_1.MessageLayout {...props} {...messageProps} orientation="landscape" styles={messageStyles} testID={`inappmessaging-${position}banner-dialog`}/>
|
|
18
|
+
</MessageWrapper_1.MessageWrapper>);
|
|
19
|
+
}
|
|
20
|
+
exports.default = BannerMessage;
|
|
@@ -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.BannerMessage = void 0;
|
|
7
|
+
var BannerMessage_1 = require("./BannerMessage");
|
|
8
|
+
Object.defineProperty(exports, "BannerMessage", { enumerable: true, get: function () { return __importDefault(BannerMessage_1).default; } });
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStyles = exports.positionStyle = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
exports.positionStyle = {
|
|
6
|
+
bottom: {
|
|
7
|
+
justifyContent: 'flex-end',
|
|
8
|
+
},
|
|
9
|
+
middle: {
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
},
|
|
12
|
+
top: {
|
|
13
|
+
justifyContent: 'flex-start',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const getStyles = (imageDimensions, additionalStyle) => ({
|
|
17
|
+
body: {
|
|
18
|
+
fontSize: constants_1.FONT_SIZE_BASE,
|
|
19
|
+
fontWeight: constants_1.FONT_WEIGHT_BASE,
|
|
20
|
+
lineHeight: constants_1.LINE_HEIGHT_BASE,
|
|
21
|
+
},
|
|
22
|
+
buttonContainer: {
|
|
23
|
+
backgroundColor: constants_1.COLOR_LIGHT_GREY,
|
|
24
|
+
borderRadius: constants_1.BORDER_RADIUS_BASE,
|
|
25
|
+
flex: 1,
|
|
26
|
+
margin: constants_1.SPACING_MEDIUM,
|
|
27
|
+
padding: constants_1.SPACING_LARGE,
|
|
28
|
+
},
|
|
29
|
+
buttonsContainer: {
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
padding: constants_1.SPACING_SMALL,
|
|
33
|
+
},
|
|
34
|
+
buttonText: {
|
|
35
|
+
fontSize: constants_1.FONT_SIZE_BASE,
|
|
36
|
+
fontWeight: constants_1.FONT_WEIGHT_BASE,
|
|
37
|
+
lineHeight: constants_1.LINE_HEIGHT_BASE,
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
},
|
|
40
|
+
container: {
|
|
41
|
+
backgroundColor: constants_1.COLOR_WHITE,
|
|
42
|
+
elevation: constants_1.MESSAGE_ELEVATION,
|
|
43
|
+
margin: constants_1.SPACING_EXTRA_LARGE,
|
|
44
|
+
shadowColor: constants_1.COLOR_BLACK,
|
|
45
|
+
shadowOffset: {
|
|
46
|
+
width: constants_1.MESSAGE_SHADOW_WIDTH,
|
|
47
|
+
height: constants_1.MESSAGE_SHADOW_HEIGHT,
|
|
48
|
+
},
|
|
49
|
+
shadowOpacity: constants_1.MESSAGE_SHADOW_OPACITY,
|
|
50
|
+
shadowRadius: constants_1.MESSAGE_SHADOW_RADIUS,
|
|
51
|
+
},
|
|
52
|
+
contentContainer: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
padding: constants_1.SPACING_LARGE,
|
|
55
|
+
},
|
|
56
|
+
header: {
|
|
57
|
+
fontSize: constants_1.FONT_SIZE_LARGE,
|
|
58
|
+
fontWeight: constants_1.FONT_WEIGHT_BOLD,
|
|
59
|
+
lineHeight: constants_1.LINE_HEIGHT_LARGE,
|
|
60
|
+
},
|
|
61
|
+
iconButton: {
|
|
62
|
+
alignSelf: 'flex-start',
|
|
63
|
+
marginLeft: 'auto',
|
|
64
|
+
},
|
|
65
|
+
image: {
|
|
66
|
+
...imageDimensions,
|
|
67
|
+
},
|
|
68
|
+
imageContainer: {
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
},
|
|
71
|
+
textContainer: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
paddingHorizontal: constants_1.SPACING_MEDIUM,
|
|
74
|
+
},
|
|
75
|
+
wrapper: {
|
|
76
|
+
...additionalStyle?.position,
|
|
77
|
+
backgroundColor: 'transparent',
|
|
78
|
+
flex: 1,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
exports.getStyles = getStyles;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const primitives_1 = require("../../../primitives");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const MessageWrapper_1 = require("../MessageWrapper");
|
|
8
|
+
const CarouselMessageItem_1 = tslib_1.__importDefault(require("./CarouselMessageItem"));
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
function CarouselMessage(props) {
|
|
11
|
+
const { data, ...rest } = props;
|
|
12
|
+
const { style } = rest;
|
|
13
|
+
const indicatorStyle = (0, react_1.useMemo)(() => ({
|
|
14
|
+
active: [styles_1.defaultStyle.pageIndicatorActive, style?.pageIndicatorActive],
|
|
15
|
+
inactive: [
|
|
16
|
+
styles_1.defaultStyle.pageIndicatorInactive,
|
|
17
|
+
style?.pageIndicatorInactive,
|
|
18
|
+
],
|
|
19
|
+
}), [style]);
|
|
20
|
+
const renderItem = ({ item }) => (<CarouselMessageItem_1.default {...item} {...rest}/>);
|
|
21
|
+
return (<MessageWrapper_1.MessageWrapper disableSafeAreaView>
|
|
22
|
+
<primitives_1.Carousel data={data ?? []} renderItem={renderItem} indicatorActiveStyle={indicatorStyle.active} indicatorInactiveStyle={indicatorStyle.inactive} testID={constants_1.IN_APP_MESSAGING_TEST_ID.CAROUSEL}/>
|
|
23
|
+
</MessageWrapper_1.MessageWrapper>);
|
|
24
|
+
}
|
|
25
|
+
exports.default = CarouselMessage;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
|
+
const hooks_1 = require("../../../hooks");
|
|
7
|
+
const hooks_2 = require("../../hooks");
|
|
8
|
+
const MessageLayout_1 = require("../MessageLayout");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
function CarouselMessageItem(props) {
|
|
11
|
+
const { deviceOrientation, isPortraitMode } = (0, hooks_1.useDeviceOrientation)();
|
|
12
|
+
const messageProps = (0, hooks_2.useMessageProps)(props, isPortraitMode ? styles_1.getPortraitStyles : styles_1.getLandscapeStyles);
|
|
13
|
+
const { shouldRenderMessage, styles } = messageProps;
|
|
14
|
+
if (!shouldRenderMessage) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const { wrapper, ...messageStyles } = styles;
|
|
18
|
+
return (<react_native_safe_area_context_1.SafeAreaView style={wrapper}>
|
|
19
|
+
<MessageLayout_1.MessageLayout {...props} {...messageProps} orientation={deviceOrientation} styles={messageStyles}/>
|
|
20
|
+
</react_native_safe_area_context_1.SafeAreaView>);
|
|
21
|
+
}
|
|
22
|
+
exports.default = CarouselMessageItem;
|
|
@@ -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.CarouselMessage = void 0;
|
|
7
|
+
var CarouselMessage_1 = require("./CarouselMessage");
|
|
8
|
+
Object.defineProperty(exports, "CarouselMessage", { enumerable: true, get: function () { return __importDefault(CarouselMessage_1).default; } });
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLandscapeStyles = exports.getPortraitStyles = exports.defaultStyle = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.defaultStyle = react_native_1.StyleSheet.create({
|
|
7
|
+
pageIndicatorActive: {
|
|
8
|
+
backgroundColor: constants_1.COLOR_GREY,
|
|
9
|
+
borderRadius: constants_1.SPACING_LARGE / 2,
|
|
10
|
+
height: constants_1.SPACING_LARGE,
|
|
11
|
+
margin: constants_1.SPACING_SMALL,
|
|
12
|
+
width: constants_1.SPACING_LARGE,
|
|
13
|
+
},
|
|
14
|
+
pageIndicatorInactive: {
|
|
15
|
+
backgroundColor: constants_1.COLOR_LIGHT_GREY_2,
|
|
16
|
+
borderRadius: constants_1.SPACING_LARGE / 2,
|
|
17
|
+
height: constants_1.SPACING_LARGE,
|
|
18
|
+
margin: constants_1.SPACING_SMALL,
|
|
19
|
+
width: constants_1.SPACING_LARGE,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const commonStyles = {
|
|
23
|
+
body: {
|
|
24
|
+
fontSize: constants_1.FONT_SIZE_BASE,
|
|
25
|
+
fontWeight: constants_1.FONT_WEIGHT_BASE,
|
|
26
|
+
lineHeight: constants_1.LINE_HEIGHT_BASE,
|
|
27
|
+
},
|
|
28
|
+
buttonContainer: {
|
|
29
|
+
backgroundColor: constants_1.COLOR_LIGHT_GREY,
|
|
30
|
+
borderRadius: constants_1.BORDER_RADIUS_BASE,
|
|
31
|
+
flex: 1,
|
|
32
|
+
margin: constants_1.SPACING_MEDIUM,
|
|
33
|
+
padding: constants_1.SPACING_LARGE,
|
|
34
|
+
},
|
|
35
|
+
buttonsContainer: {
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
},
|
|
39
|
+
buttonText: {
|
|
40
|
+
fontSize: constants_1.FONT_SIZE_BASE,
|
|
41
|
+
fontWeight: constants_1.FONT_WEIGHT_BASE,
|
|
42
|
+
lineHeight: constants_1.LINE_HEIGHT_BASE,
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
},
|
|
45
|
+
container: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
padding: constants_1.SPACING_EXTRA_LARGE,
|
|
48
|
+
},
|
|
49
|
+
contentContainer: {
|
|
50
|
+
flex: 1,
|
|
51
|
+
},
|
|
52
|
+
header: {
|
|
53
|
+
fontSize: constants_1.FONT_SIZE_LARGE,
|
|
54
|
+
fontWeight: constants_1.FONT_WEIGHT_BOLD,
|
|
55
|
+
lineHeight: constants_1.LINE_HEIGHT_LARGE,
|
|
56
|
+
},
|
|
57
|
+
iconButton: {
|
|
58
|
+
alignSelf: 'flex-start',
|
|
59
|
+
marginBottom: constants_1.SPACING_MEDIUM,
|
|
60
|
+
marginLeft: 'auto',
|
|
61
|
+
marginRight: constants_1.SPACING_MEDIUM,
|
|
62
|
+
},
|
|
63
|
+
imageContainer: {
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
margin: constants_1.SPACING_LARGE,
|
|
66
|
+
},
|
|
67
|
+
textContainer: {
|
|
68
|
+
paddingHorizontal: constants_1.SPACING_MEDIUM,
|
|
69
|
+
},
|
|
70
|
+
wrapper: {
|
|
71
|
+
backgroundColor: constants_1.COLOR_WHITE,
|
|
72
|
+
flex: 1,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
const getPortraitStyles = (imageDimensions) => react_native_1.StyleSheet.create({
|
|
76
|
+
...commonStyles,
|
|
77
|
+
image: { ...imageDimensions },
|
|
78
|
+
textContainer: {
|
|
79
|
+
...commonStyles.textContainer,
|
|
80
|
+
marginVertical: constants_1.SPACING_LARGE,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
exports.getPortraitStyles = getPortraitStyles;
|
|
84
|
+
const getLandscapeStyles = (imageDimensions) => react_native_1.StyleSheet.create({
|
|
85
|
+
...commonStyles,
|
|
86
|
+
contentContainer: {
|
|
87
|
+
...commonStyles.contentContainer,
|
|
88
|
+
alignContent: 'center',
|
|
89
|
+
justifyContent: 'center',
|
|
90
|
+
flexDirection: 'row',
|
|
91
|
+
},
|
|
92
|
+
image: { ...imageDimensions },
|
|
93
|
+
imageContainer: {
|
|
94
|
+
...commonStyles.imageContainer,
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
},
|
|
97
|
+
textContainer: {
|
|
98
|
+
...commonStyles.textContainer,
|
|
99
|
+
flex: 1,
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
exports.getLandscapeStyles = getLandscapeStyles;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const hooks_1 = require("../../../hooks");
|
|
6
|
+
const hooks_2 = require("../../hooks");
|
|
7
|
+
const MessageLayout_1 = require("../MessageLayout");
|
|
8
|
+
const MessageWrapper_1 = require("../MessageWrapper");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
function FullScreenMessage(props) {
|
|
11
|
+
const { deviceOrientation, isPortraitMode } = (0, hooks_1.useDeviceOrientation)();
|
|
12
|
+
const messageProps = (0, hooks_2.useMessageProps)(props, isPortraitMode ? styles_1.getPortraitStyles : styles_1.getLandscapeStyles);
|
|
13
|
+
const { shouldRenderMessage, styles } = messageProps;
|
|
14
|
+
if (!shouldRenderMessage) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const { wrapper, ...messageStyles } = styles;
|
|
18
|
+
return (<MessageWrapper_1.MessageWrapper style={wrapper}>
|
|
19
|
+
<MessageLayout_1.MessageLayout {...props} {...messageProps} orientation={deviceOrientation} styles={messageStyles} testID={`inappmessaging-fullscreen-dialog`}/>
|
|
20
|
+
</MessageWrapper_1.MessageWrapper>);
|
|
21
|
+
}
|
|
22
|
+
exports.default = FullScreenMessage;
|
|
@@ -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.FullScreenMessage = void 0;
|
|
7
|
+
var FullScreenMessage_1 = require("./FullScreenMessage");
|
|
8
|
+
Object.defineProperty(exports, "FullScreenMessage", { enumerable: true, get: function () { return __importDefault(FullScreenMessage_1).default; } });
|