@aws-amplify/ui-react-native 0.0.0-fileuploader-41bde68-20221115171326
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/.eslintrc.js +100 -0
- package/.lintstagedrc.js +6 -0
- package/.turbo/turbo-build.log +3 -0
- package/CHANGELOG.md +22 -0
- package/LICENSE +201 -0
- package/README.md +23 -0
- package/babel.config.js +3 -0
- package/dist/InAppMessaging/components/BannerMessage/BannerMessage.d.ts +2 -0
- package/dist/InAppMessaging/components/BannerMessage/BannerMessage.js +16 -0
- package/dist/InAppMessaging/components/BannerMessage/index.d.ts +2 -0
- package/dist/InAppMessaging/components/BannerMessage/index.js +1 -0
- package/dist/InAppMessaging/components/BannerMessage/styles.d.ts +7 -0
- package/dist/InAppMessaging/components/BannerMessage/styles.js +77 -0
- package/dist/InAppMessaging/components/BannerMessage/types.d.ts +12 -0
- package/dist/InAppMessaging/components/BannerMessage/types.js +1 -0
- package/dist/InAppMessaging/components/CarouselMessage/CarouselMessage.d.ts +2 -0
- package/dist/InAppMessaging/components/CarouselMessage/CarouselMessage.js +20 -0
- package/dist/InAppMessaging/components/CarouselMessage/CarouselMessageItem.d.ts +2 -0
- package/dist/InAppMessaging/components/CarouselMessage/CarouselMessageItem.js +18 -0
- package/dist/InAppMessaging/components/CarouselMessage/index.d.ts +2 -0
- package/dist/InAppMessaging/components/CarouselMessage/index.js +1 -0
- package/dist/InAppMessaging/components/CarouselMessage/styles.d.ts +5 -0
- package/dist/InAppMessaging/components/CarouselMessage/styles.js +98 -0
- package/dist/InAppMessaging/components/CarouselMessage/types.d.ts +18 -0
- package/dist/InAppMessaging/components/CarouselMessage/types.js +1 -0
- package/dist/InAppMessaging/components/FullScreenMessage/FullScreenMessage.d.ts +2 -0
- package/dist/InAppMessaging/components/FullScreenMessage/FullScreenMessage.js +18 -0
- package/dist/InAppMessaging/components/FullScreenMessage/index.d.ts +2 -0
- package/dist/InAppMessaging/components/FullScreenMessage/index.js +1 -0
- package/dist/InAppMessaging/components/FullScreenMessage/styles.d.ts +3 -0
- package/dist/InAppMessaging/components/FullScreenMessage/styles.js +86 -0
- package/dist/InAppMessaging/components/FullScreenMessage/types.d.ts +6 -0
- package/dist/InAppMessaging/components/FullScreenMessage/types.js +1 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.d.ts +9 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.js +29 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.d.ts +3 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +24 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/index.d.ts +2 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/index.js +1 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/types.d.ts +24 -0
- package/dist/InAppMessaging/components/InAppMessageDisplay/types.js +1 -0
- package/dist/InAppMessaging/components/MessageLayout/MessageLayout.d.ts +2 -0
- package/dist/InAppMessaging/components/MessageLayout/MessageLayout.js +34 -0
- package/dist/InAppMessaging/components/MessageLayout/index.d.ts +1 -0
- package/dist/InAppMessaging/components/MessageLayout/index.js +1 -0
- package/dist/InAppMessaging/components/MessageLayout/types.d.ts +7 -0
- package/dist/InAppMessaging/components/MessageLayout/types.js +1 -0
- package/dist/InAppMessaging/components/MessageWrapper/MessageWrapper.d.ts +2 -0
- package/dist/InAppMessaging/components/MessageWrapper/MessageWrapper.js +20 -0
- package/dist/InAppMessaging/components/MessageWrapper/index.d.ts +2 -0
- package/dist/InAppMessaging/components/MessageWrapper/index.js +1 -0
- package/dist/InAppMessaging/components/MessageWrapper/styles.d.ts +2 -0
- package/dist/InAppMessaging/components/MessageWrapper/styles.js +5 -0
- package/dist/InAppMessaging/components/MessageWrapper/types.d.ts +10 -0
- package/dist/InAppMessaging/components/MessageWrapper/types.js +1 -0
- package/dist/InAppMessaging/components/ModalMessage/ModalMessage.d.ts +2 -0
- package/dist/InAppMessaging/components/ModalMessage/ModalMessage.js +18 -0
- package/dist/InAppMessaging/components/ModalMessage/index.d.ts +2 -0
- package/dist/InAppMessaging/components/ModalMessage/index.js +1 -0
- package/dist/InAppMessaging/components/ModalMessage/styles.d.ts +4 -0
- package/dist/InAppMessaging/components/ModalMessage/styles.js +99 -0
- package/dist/InAppMessaging/components/ModalMessage/types.d.ts +6 -0
- package/dist/InAppMessaging/components/ModalMessage/types.js +1 -0
- package/dist/InAppMessaging/components/index.d.ts +6 -0
- package/dist/InAppMessaging/components/index.js +2 -0
- package/dist/InAppMessaging/components/withInAppMessaging/index.d.ts +1 -0
- package/dist/InAppMessaging/components/withInAppMessaging/index.js +1 -0
- package/dist/InAppMessaging/components/withInAppMessaging/withInAppMessaging.d.ts +5 -0
- package/dist/InAppMessaging/components/withInAppMessaging/withInAppMessaging.js +11 -0
- package/dist/InAppMessaging/constants.d.ts +32 -0
- package/dist/InAppMessaging/constants.js +44 -0
- package/dist/InAppMessaging/hooks/index.d.ts +2 -0
- package/dist/InAppMessaging/hooks/index.js +2 -0
- package/dist/InAppMessaging/hooks/useMessageImage/constants.d.ts +8 -0
- package/dist/InAppMessaging/hooks/useMessageImage/constants.js +18 -0
- package/dist/InAppMessaging/hooks/useMessageImage/index.d.ts +2 -0
- package/dist/InAppMessaging/hooks/useMessageImage/index.js +1 -0
- package/dist/InAppMessaging/hooks/useMessageImage/types.d.ts +15 -0
- package/dist/InAppMessaging/hooks/useMessageImage/types.js +6 -0
- package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.d.ts +10 -0
- package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.js +50 -0
- package/dist/InAppMessaging/hooks/useMessageImage/utils.d.ts +4 -0
- package/dist/InAppMessaging/hooks/useMessageImage/utils.js +56 -0
- package/dist/InAppMessaging/hooks/useMessageProps/index.d.ts +2 -0
- package/dist/InAppMessaging/hooks/useMessageProps/index.js +1 -0
- package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +109 -0
- package/dist/InAppMessaging/hooks/useMessageProps/types.js +1 -0
- package/dist/InAppMessaging/hooks/useMessageProps/useMessageProps.d.ts +12 -0
- package/dist/InAppMessaging/hooks/useMessageProps/useMessageProps.js +49 -0
- package/dist/InAppMessaging/hooks/useMessageProps/utils.d.ts +43 -0
- package/dist/InAppMessaging/hooks/useMessageProps/utils.js +192 -0
- package/dist/InAppMessaging/index.d.ts +2 -0
- package/dist/InAppMessaging/index.js +2 -0
- package/dist/__mocks__/@react-native-async-storage/async-storage.d.ts +1 -0
- package/dist/__mocks__/@react-native-async-storage/async-storage.js +2 -0
- package/dist/__mocks__/@react-native-community/netinfo.d.ts +1 -0
- package/dist/__mocks__/@react-native-community/netinfo.js +2 -0
- package/dist/__mocks__/react-native-safe-area-context.d.ts +3 -0
- package/dist/__mocks__/react-native-safe-area-context.js +4 -0
- package/dist/assets/icons/checkboxFilled.png +0 -0
- package/dist/assets/icons/checkboxOutline.png +0 -0
- package/dist/assets/icons/close.png +0 -0
- package/dist/assets/icons/index.d.ts +7 -0
- package/dist/assets/icons/index.js +6 -0
- package/dist/assets/icons/index.ts +9 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/assets/index.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDeviceOrientation/index.d.ts +1 -0
- package/dist/hooks/useDeviceOrientation/index.js +1 -0
- package/dist/hooks/useDeviceOrientation/useDeviceOrientation.d.ts +6 -0
- package/dist/hooks/useDeviceOrientation/useDeviceOrientation.js +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/primitives/Button/Button.d.ts +2 -0
- package/dist/primitives/Button/Button.js +8 -0
- package/dist/primitives/Button/index.d.ts +2 -0
- package/dist/primitives/Button/index.js +1 -0
- package/dist/primitives/Button/styles.d.ts +2 -0
- package/dist/primitives/Button/styles.js +4 -0
- package/dist/primitives/Button/types.d.ts +7 -0
- package/dist/primitives/Button/types.js +1 -0
- package/dist/primitives/Carousel/Carousel.d.ts +2 -0
- package/dist/primitives/Carousel/Carousel.js +58 -0
- package/dist/primitives/Carousel/CarouselPageIndicator.d.ts +2 -0
- package/dist/primitives/Carousel/CarouselPageIndicator.js +10 -0
- package/dist/primitives/Carousel/constants.d.ts +9 -0
- package/dist/primitives/Carousel/constants.js +18 -0
- package/dist/primitives/Carousel/index.d.ts +3 -0
- package/dist/primitives/Carousel/index.js +2 -0
- package/dist/primitives/Carousel/styles.d.ts +2 -0
- package/dist/primitives/Carousel/styles.js +11 -0
- package/dist/primitives/Carousel/types.d.ts +19 -0
- package/dist/primitives/Carousel/types.js +1 -0
- package/dist/primitives/Checkbox/Checkbox.d.ts +2 -0
- package/dist/primitives/Checkbox/Checkbox.js +23 -0
- package/dist/primitives/Checkbox/index.d.ts +2 -0
- package/dist/primitives/Checkbox/index.js +1 -0
- package/dist/primitives/Checkbox/styles.d.ts +2 -0
- package/dist/primitives/Checkbox/styles.js +6 -0
- package/dist/primitives/Checkbox/types.d.ts +18 -0
- package/dist/primitives/Checkbox/types.js +1 -0
- package/dist/primitives/Heading/Heading.d.ts +2 -0
- package/dist/primitives/Heading/Heading.js +8 -0
- package/dist/primitives/Heading/index.d.ts +2 -0
- package/dist/primitives/Heading/index.js +1 -0
- package/dist/primitives/Heading/styles.d.ts +2 -0
- package/dist/primitives/Heading/styles.js +14 -0
- package/dist/primitives/Heading/types.d.ts +11 -0
- package/dist/primitives/Heading/types.js +1 -0
- package/dist/primitives/Icon/Icon.d.ts +2 -0
- package/dist/primitives/Icon/Icon.js +10 -0
- package/dist/primitives/Icon/index.d.ts +2 -0
- package/dist/primitives/Icon/index.js +1 -0
- package/dist/primitives/Icon/styles.d.ts +2 -0
- package/dist/primitives/Icon/styles.js +9 -0
- package/dist/primitives/Icon/types.d.ts +18 -0
- package/dist/primitives/Icon/types.js +1 -0
- package/dist/primitives/IconButton/IconButton.d.ts +2 -0
- package/dist/primitives/IconButton/IconButton.js +8 -0
- package/dist/primitives/IconButton/index.d.ts +2 -0
- package/dist/primitives/IconButton/index.js +1 -0
- package/dist/primitives/IconButton/styles.d.ts +0 -0
- package/dist/primitives/IconButton/styles.js +1 -0
- package/dist/primitives/IconButton/types.d.ts +22 -0
- package/dist/primitives/IconButton/types.js +1 -0
- package/dist/primitives/Label/Label.d.ts +2 -0
- package/dist/primitives/Label/Label.js +8 -0
- package/dist/primitives/Label/index.d.ts +2 -0
- package/dist/primitives/Label/index.js +1 -0
- package/dist/primitives/Label/styles.d.ts +2 -0
- package/dist/primitives/Label/styles.js +4 -0
- package/dist/primitives/Label/types.d.ts +7 -0
- package/dist/primitives/Label/types.js +1 -0
- package/dist/primitives/Label/utils.d.ts +17 -0
- package/dist/primitives/Label/utils.js +21 -0
- package/dist/primitives/Radio/Radio.d.ts +2 -0
- package/dist/primitives/Radio/Radio.js +29 -0
- package/dist/primitives/Radio/getRadioDimensions.d.ts +18 -0
- package/dist/primitives/Radio/getRadioDimensions.js +27 -0
- package/dist/primitives/Radio/index.d.ts +2 -0
- package/dist/primitives/Radio/index.js +1 -0
- package/dist/primitives/Radio/styles.d.ts +2 -0
- package/dist/primitives/Radio/styles.js +46 -0
- package/dist/primitives/Radio/types.d.ts +28 -0
- package/dist/primitives/Radio/types.js +1 -0
- package/dist/primitives/index.d.ts +8 -0
- package/dist/primitives/index.js +8 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +7 -0
- package/jest.config.js +20 -0
- package/package.json +57 -0
- package/src/InAppMessaging/components/BannerMessage/BannerMessage.tsx +37 -0
- package/src/InAppMessaging/components/BannerMessage/__tests__/BannerMessage.spec.tsx +138 -0
- package/src/InAppMessaging/components/BannerMessage/__tests__/__snapshots__/BannerMessage.spec.tsx.snap +230 -0
- package/src/InAppMessaging/components/BannerMessage/index.ts +2 -0
- package/src/InAppMessaging/components/BannerMessage/styles.ts +106 -0
- package/src/InAppMessaging/components/BannerMessage/types.ts +15 -0
- package/src/InAppMessaging/components/CarouselMessage/CarouselMessage.tsx +42 -0
- package/src/InAppMessaging/components/CarouselMessage/CarouselMessageItem.tsx +37 -0
- package/src/InAppMessaging/components/CarouselMessage/__tests__/CarouselMessage.spec.tsx +55 -0
- package/src/InAppMessaging/components/CarouselMessage/__tests__/CarouselMessageItem.spec.tsx +56 -0
- package/src/InAppMessaging/components/CarouselMessage/__tests__/__snapshots__/CarouselMessage.spec.tsx.snap +86 -0
- package/src/InAppMessaging/components/CarouselMessage/__tests__/__snapshots__/CarouselMessageItem.spec.tsx.snap +248 -0
- package/src/InAppMessaging/components/CarouselMessage/index.ts +2 -0
- package/src/InAppMessaging/components/CarouselMessage/styles.ts +126 -0
- package/src/InAppMessaging/components/CarouselMessage/types.ts +28 -0
- package/src/InAppMessaging/components/FullScreenMessage/FullScreenMessage.tsx +38 -0
- package/src/InAppMessaging/components/FullScreenMessage/__tests__/FullScreenMessage.spec.tsx +53 -0
- package/src/InAppMessaging/components/FullScreenMessage/__tests__/__snapshots__/FullScreenMessage.spec.tsx.snap +236 -0
- package/src/InAppMessaging/components/FullScreenMessage/index.ts +2 -0
- package/src/InAppMessaging/components/FullScreenMessage/styles.ts +107 -0
- package/src/InAppMessaging/components/FullScreenMessage/types.ts +7 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.tsx +48 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/InAppMessageDisplay.spec.tsx +31 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/__snapshots__/InAppMessageDisplay.spec.tsx.snap +9 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/handleMessageLinkAction.spec.ts +51 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.ts +30 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/index.ts +2 -0
- package/src/InAppMessaging/components/InAppMessageDisplay/types.ts +32 -0
- package/src/InAppMessaging/components/MessageLayout/MessageLayout.tsx +102 -0
- package/src/InAppMessaging/components/MessageLayout/index.ts +1 -0
- package/src/InAppMessaging/components/MessageLayout/types.ts +15 -0
- package/src/InAppMessaging/components/MessageWrapper/MessageWrapper.tsx +34 -0
- package/src/InAppMessaging/components/MessageWrapper/__tests__/MessageWrapper.spec.tsx +19 -0
- package/src/InAppMessaging/components/MessageWrapper/__tests__/__snapshots__/MessageWrapper.spec.tsx.snap +35 -0
- package/src/InAppMessaging/components/MessageWrapper/index.ts +2 -0
- package/src/InAppMessaging/components/MessageWrapper/styles.ts +7 -0
- package/src/InAppMessaging/components/MessageWrapper/types.ts +12 -0
- package/src/InAppMessaging/components/ModalMessage/ModalMessage.tsx +37 -0
- package/src/InAppMessaging/components/ModalMessage/__tests__/ModalMessage.spec.tsx +155 -0
- package/src/InAppMessaging/components/ModalMessage/__tests__/__snapshots__/ModalMessage.spec.tsx.snap +332 -0
- package/src/InAppMessaging/components/ModalMessage/index.ts +2 -0
- package/src/InAppMessaging/components/ModalMessage/styles.ts +133 -0
- package/src/InAppMessaging/components/ModalMessage/types.ts +8 -0
- package/src/InAppMessaging/components/index.ts +6 -0
- package/src/InAppMessaging/components/withInAppMessaging/__tests__/__snapshots__/withInAppMessaging.spec.tsx.snap +3 -0
- package/src/InAppMessaging/components/withInAppMessaging/__tests__/withInAppMessaging.spec.tsx +15 -0
- package/src/InAppMessaging/components/withInAppMessaging/index.ts +1 -0
- package/src/InAppMessaging/components/withInAppMessaging/withInAppMessaging.tsx +18 -0
- package/src/InAppMessaging/constants.ts +57 -0
- package/src/InAppMessaging/hooks/index.ts +9 -0
- package/src/InAppMessaging/hooks/useMessageImage/__tests__/useMessageImage.spec.ts +141 -0
- package/src/InAppMessaging/hooks/useMessageImage/__tests__/utils.spec.ts +107 -0
- package/src/InAppMessaging/hooks/useMessageImage/constants.ts +27 -0
- package/src/InAppMessaging/hooks/useMessageImage/index.ts +2 -0
- package/src/InAppMessaging/hooks/useMessageImage/types.ts +18 -0
- package/src/InAppMessaging/hooks/useMessageImage/useMessageImage.ts +74 -0
- package/src/InAppMessaging/hooks/useMessageImage/utils.ts +80 -0
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/__snapshots__/utils.spec.ts.snap +223 -0
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/useMessageProps.spec.ts +162 -0
- package/src/InAppMessaging/hooks/useMessageProps/__tests__/utils.spec.ts +354 -0
- package/src/InAppMessaging/hooks/useMessageProps/index.ts +8 -0
- package/src/InAppMessaging/hooks/useMessageProps/types.ts +131 -0
- package/src/InAppMessaging/hooks/useMessageProps/useMessageProps.ts +70 -0
- package/src/InAppMessaging/hooks/useMessageProps/utils.ts +274 -0
- package/src/InAppMessaging/index.ts +14 -0
- package/src/__mocks__/@react-native-async-storage/async-storage.ts +2 -0
- package/src/__mocks__/@react-native-community/netinfo.ts +2 -0
- package/src/__mocks__/react-native-safe-area-context.ts +6 -0
- package/src/__tests__/__snapshots__/index.spec.ts.snap +15 -0
- package/src/__tests__/index.spec.ts +8 -0
- package/src/assets/icons/checkboxFilled.png +0 -0
- package/src/assets/icons/checkboxOutline.png +0 -0
- package/src/assets/icons/close.png +0 -0
- package/src/assets/icons/index.ts +9 -0
- package/src/assets/index.ts +1 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDeviceOrientation/__tests__/useDeviceOrientation.spec.ts +87 -0
- package/src/hooks/useDeviceOrientation/index.ts +4 -0
- package/src/hooks/useDeviceOrientation/useDeviceOrientation.ts +47 -0
- package/src/index.ts +1 -0
- package/src/primitives/Button/Button.tsx +21 -0
- package/src/primitives/Button/__tests__/Button.spec.tsx +24 -0
- package/src/primitives/Button/__tests__/__snapshots__/Button.spec.tsx.snap +52 -0
- package/src/primitives/Button/index.ts +2 -0
- package/src/primitives/Button/styles.ts +6 -0
- package/src/primitives/Button/types.ts +9 -0
- package/src/primitives/Carousel/Carousel.tsx +115 -0
- package/src/primitives/Carousel/CarouselPageIndicator.tsx +39 -0
- package/src/primitives/Carousel/__tests__/Carousel.spec.tsx +185 -0
- package/src/primitives/Carousel/__tests__/CarouselPageIndicator.spec.tsx +71 -0
- package/src/primitives/Carousel/__tests__/__snapshots__/Carousel.spec.tsx.snap +216 -0
- package/src/primitives/Carousel/__tests__/__snapshots__/CarouselPageIndicator.spec.tsx.snap +191 -0
- package/src/primitives/Carousel/constants.ts +25 -0
- package/src/primitives/Carousel/index.ts +3 -0
- package/src/primitives/Carousel/styles.ts +14 -0
- package/src/primitives/Carousel/types.ts +22 -0
- package/src/primitives/Checkbox/Checkbox.tsx +57 -0
- package/src/primitives/Checkbox/__tests__/Checkbox.spec.tsx +50 -0
- package/src/primitives/Checkbox/__tests__/__snapshots__/Checkbox.spec.tsx.snap +198 -0
- package/src/primitives/Checkbox/index.ts +2 -0
- package/src/primitives/Checkbox/styles.ts +8 -0
- package/src/primitives/Checkbox/types.ts +20 -0
- package/src/primitives/Heading/Heading.tsx +22 -0
- package/src/primitives/Heading/__tests__/Heading.spec.tsx +36 -0
- package/src/primitives/Heading/__tests__/__snapshots__/Heading.spec.tsx.snap +150 -0
- package/src/primitives/Heading/index.ts +2 -0
- package/src/primitives/Heading/styles.ts +16 -0
- package/src/primitives/Heading/types.ts +13 -0
- package/src/primitives/Icon/Icon.tsx +20 -0
- package/src/primitives/Icon/__tests__/Icon.spec.tsx +25 -0
- package/src/primitives/Icon/__tests__/__snapshots__/Icon.spec.tsx.snap +64 -0
- package/src/primitives/Icon/index.ts +2 -0
- package/src/primitives/Icon/styles.ts +16 -0
- package/src/primitives/Icon/types.ts +22 -0
- package/src/primitives/IconButton/IconButton.tsx +19 -0
- package/src/primitives/IconButton/__tests__/IconButton.spec.tsx +23 -0
- package/src/primitives/IconButton/__tests__/__snapshots__/IconButton.spec.tsx.snap +75 -0
- package/src/primitives/IconButton/index.ts +2 -0
- package/src/primitives/IconButton/styles.ts +0 -0
- package/src/primitives/IconButton/types.ts +33 -0
- package/src/primitives/Label/Label.tsx +21 -0
- package/src/primitives/Label/__tests__/Label.spec.tsx +22 -0
- package/src/primitives/Label/__tests__/__snapshots__/Label.spec.tsx.snap +39 -0
- package/src/primitives/Label/index.ts +2 -0
- package/src/primitives/Label/styles.ts +7 -0
- package/src/primitives/Label/types.ts +8 -0
- package/src/primitives/Label/utils.ts +27 -0
- package/src/primitives/Radio/Radio.tsx +75 -0
- package/src/primitives/Radio/__tests__/Radio.spec.tsx +70 -0
- package/src/primitives/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +555 -0
- package/src/primitives/Radio/getRadioDimensions.ts +38 -0
- package/src/primitives/Radio/index.ts +2 -0
- package/src/primitives/Radio/styles.ts +50 -0
- package/src/primitives/Radio/types.ts +32 -0
- package/src/primitives/index.ts +8 -0
- package/src/utils/index.ts +10 -0
- package/tsconfig.dist.json +4 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { CarouselMessageCommonProps, MessageComponentBaseProps } from '@aws-amplify/ui-react-core';
|
|
3
|
+
import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
|
|
4
|
+
interface CarouselMessageOverrideStyle extends MessageOverrideStyle {
|
|
5
|
+
pageIndicatorActive?: StyleProp<ViewStyle>;
|
|
6
|
+
pageIndicatorInactive?: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
export interface CarouselMessageProps extends CarouselMessageCommonProps<CarouselMessageOverrideStyle | undefined> {
|
|
9
|
+
}
|
|
10
|
+
export interface CarouselMessageItemProps extends MessageComponentBaseProps<CarouselMessageOverrideStyle> {
|
|
11
|
+
}
|
|
12
|
+
export interface CarouselMessageStyle extends MessageDefaultStyle {
|
|
13
|
+
}
|
|
14
|
+
export interface CarouselMessageComponentStyle {
|
|
15
|
+
pageIndicatorActive: ViewStyle;
|
|
16
|
+
pageIndicatorInactive: ViewStyle;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDeviceOrientation } from '../../../hooks';
|
|
3
|
+
import { useMessageProps } from '../../hooks';
|
|
4
|
+
import { MessageLayout } from '../MessageLayout';
|
|
5
|
+
import { MessageWrapper } from '../MessageWrapper';
|
|
6
|
+
import { getLandscapeStyles, getPortraitStyles } from './styles';
|
|
7
|
+
export default function FullScreenMessage(props) {
|
|
8
|
+
const { deviceOrientation, isPortraitMode } = useDeviceOrientation();
|
|
9
|
+
const messageProps = useMessageProps(props, isPortraitMode ? getPortraitStyles : getLandscapeStyles);
|
|
10
|
+
const { shouldRenderMessage, styles } = messageProps;
|
|
11
|
+
if (!shouldRenderMessage) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const { wrapper, ...messageStyles } = styles;
|
|
15
|
+
return (<MessageWrapper style={wrapper}>
|
|
16
|
+
<MessageLayout {...props} {...messageProps} orientation={deviceOrientation} styles={messageStyles}/>
|
|
17
|
+
</MessageWrapper>);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FullScreenMessage } from './FullScreenMessage';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BORDER_RADIUS_BASE, COLOR_LIGHT_GREY, COLOR_WHITE, FONT_SIZE_BASE, FONT_SIZE_LARGE, FONT_WEIGHT_BASE, FONT_WEIGHT_BOLD, LINE_HEIGHT_BASE, LINE_HEIGHT_LARGE, SPACING_EXTRA_LARGE, SPACING_LARGE, SPACING_MEDIUM, } from '../../constants';
|
|
2
|
+
const commonStyles = {
|
|
3
|
+
body: {
|
|
4
|
+
fontSize: FONT_SIZE_BASE,
|
|
5
|
+
fontWeight: FONT_WEIGHT_BASE,
|
|
6
|
+
lineHeight: LINE_HEIGHT_BASE,
|
|
7
|
+
},
|
|
8
|
+
buttonContainer: {
|
|
9
|
+
backgroundColor: COLOR_LIGHT_GREY,
|
|
10
|
+
borderRadius: BORDER_RADIUS_BASE,
|
|
11
|
+
flex: 1,
|
|
12
|
+
margin: SPACING_MEDIUM,
|
|
13
|
+
padding: SPACING_LARGE,
|
|
14
|
+
},
|
|
15
|
+
buttonsContainer: {
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
},
|
|
19
|
+
buttonText: {
|
|
20
|
+
fontSize: FONT_SIZE_BASE,
|
|
21
|
+
fontWeight: FONT_WEIGHT_BASE,
|
|
22
|
+
lineHeight: LINE_HEIGHT_BASE,
|
|
23
|
+
textAlign: 'center',
|
|
24
|
+
},
|
|
25
|
+
container: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
padding: SPACING_EXTRA_LARGE,
|
|
28
|
+
},
|
|
29
|
+
contentContainer: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
},
|
|
32
|
+
header: {
|
|
33
|
+
fontSize: FONT_SIZE_LARGE,
|
|
34
|
+
fontWeight: FONT_WEIGHT_BOLD,
|
|
35
|
+
lineHeight: LINE_HEIGHT_LARGE,
|
|
36
|
+
},
|
|
37
|
+
iconButton: {
|
|
38
|
+
alignSelf: 'flex-start',
|
|
39
|
+
marginBottom: SPACING_MEDIUM,
|
|
40
|
+
marginLeft: 'auto',
|
|
41
|
+
marginRight: SPACING_MEDIUM,
|
|
42
|
+
},
|
|
43
|
+
imageContainer: {
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
margin: SPACING_LARGE,
|
|
46
|
+
},
|
|
47
|
+
textContainer: {
|
|
48
|
+
paddingHorizontal: SPACING_MEDIUM,
|
|
49
|
+
},
|
|
50
|
+
wrapper: {
|
|
51
|
+
backgroundColor: COLOR_WHITE,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const getPortraitStyles = (imageDimensions) => ({
|
|
55
|
+
...commonStyles,
|
|
56
|
+
buttonsContainer: {
|
|
57
|
+
...commonStyles.buttonsContainer,
|
|
58
|
+
marginTop: 'auto',
|
|
59
|
+
},
|
|
60
|
+
image: imageDimensions,
|
|
61
|
+
textContainer: {
|
|
62
|
+
...commonStyles.textContainer,
|
|
63
|
+
marginVertical: SPACING_LARGE,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export const getLandscapeStyles = (imageDimensions) => ({
|
|
67
|
+
...commonStyles,
|
|
68
|
+
contentContainer: {
|
|
69
|
+
...commonStyles.contentContainer,
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
},
|
|
72
|
+
image: { ...imageDimensions },
|
|
73
|
+
imageContainer: {
|
|
74
|
+
...commonStyles.imageContainer,
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
},
|
|
77
|
+
textContainer: {
|
|
78
|
+
...commonStyles.textContainer,
|
|
79
|
+
flex: 1,
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
},
|
|
82
|
+
wrapper: {
|
|
83
|
+
...commonStyles.wrapper,
|
|
84
|
+
flex: 1,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FullScreenMessageCommonProps } from '@aws-amplify/ui-react-core';
|
|
2
|
+
import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
|
|
3
|
+
export interface FullScreenMessageProps extends FullScreenMessageCommonProps<MessageOverrideStyle | undefined> {
|
|
4
|
+
}
|
|
5
|
+
export interface FullScreenMessageStyle extends MessageDefaultStyle {
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InAppMessageDisplayProps } from './types';
|
|
2
|
+
declare function InAppMessageDisplay({ components: overrideComponents, }: InAppMessageDisplayProps): JSX.Element | null;
|
|
3
|
+
declare namespace InAppMessageDisplay {
|
|
4
|
+
var BannerMessage: typeof import("../BannerMessage").BannerMessage;
|
|
5
|
+
var CarouselMessage: typeof import("../CarouselMessage").CarouselMessage;
|
|
6
|
+
var FullScreenMessage: typeof import("../FullScreenMessage").FullScreenMessage;
|
|
7
|
+
var ModalMessage: typeof import("../ModalMessage").ModalMessage;
|
|
8
|
+
}
|
|
9
|
+
export default InAppMessageDisplay;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { handleMessageAction, useMessage, } from '@aws-amplify/ui-react-core';
|
|
3
|
+
import { BannerMessage } from '../BannerMessage';
|
|
4
|
+
import { FullScreenMessage } from '../FullScreenMessage';
|
|
5
|
+
import { CarouselMessage } from '../CarouselMessage';
|
|
6
|
+
import { ModalMessage } from '../ModalMessage';
|
|
7
|
+
import handleMessageLinkAction from './handleMessageLinkAction';
|
|
8
|
+
const platformComponents = {
|
|
9
|
+
BannerMessage,
|
|
10
|
+
CarouselMessage,
|
|
11
|
+
FullScreenMessage,
|
|
12
|
+
ModalMessage,
|
|
13
|
+
};
|
|
14
|
+
const onMessageAction = ({ action, url }) => {
|
|
15
|
+
handleMessageAction({ action, url, handleMessageLinkAction });
|
|
16
|
+
};
|
|
17
|
+
function InAppMessageDisplay({ components: overrideComponents, }) {
|
|
18
|
+
const components = React.useMemo(() => ({ ...platformComponents, ...overrideComponents }), [overrideComponents]);
|
|
19
|
+
const { Component, props } = useMessage({
|
|
20
|
+
components,
|
|
21
|
+
onMessageAction,
|
|
22
|
+
});
|
|
23
|
+
return <Component {...props}/>;
|
|
24
|
+
}
|
|
25
|
+
InAppMessageDisplay.BannerMessage = BannerMessage;
|
|
26
|
+
InAppMessageDisplay.CarouselMessage = CarouselMessage;
|
|
27
|
+
InAppMessageDisplay.FullScreenMessage = FullScreenMessage;
|
|
28
|
+
InAppMessageDisplay.ModalMessage = ModalMessage;
|
|
29
|
+
export default InAppMessageDisplay;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Linking } from 'react-native';
|
|
2
|
+
import { ConsoleLogger as Logger } from '@aws-amplify/core';
|
|
3
|
+
const logger = new Logger('Notifications.InAppMessaging');
|
|
4
|
+
const handleMessageLinkAction = async (url) => {
|
|
5
|
+
let supported = false;
|
|
6
|
+
try {
|
|
7
|
+
supported = await Linking.canOpenURL(url);
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
logger.warn(`Call to Linking.canOpenURL failed: ${e}`);
|
|
11
|
+
}
|
|
12
|
+
if (!supported) {
|
|
13
|
+
logger.warn(`Unsupported url provided: ${url}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
logger.info(`Opening url: ${url}`);
|
|
18
|
+
await Linking.openURL(url);
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
logger.warn(`Call to Linking.openURL failed: ${e}`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export default handleMessageLinkAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InAppMessageDisplay } from './InAppMessageDisplay';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BannerMessageComponent, CarouselMessageComponent, FullScreenMessageComponent, ModalMessageComponent } from '@aws-amplify/ui-react-core';
|
|
2
|
+
import { BannerMessageProps } from '../BannerMessage';
|
|
3
|
+
import { CarouselMessageProps } from '../CarouselMessage';
|
|
4
|
+
import { FullScreenMessageProps } from '../FullScreenMessage';
|
|
5
|
+
import { ModalMessageProps } from '../ModalMessage';
|
|
6
|
+
declare type BannerStyle = BannerMessageProps['style'];
|
|
7
|
+
declare type CarouselStyle = CarouselMessageProps['style'];
|
|
8
|
+
declare type FullScreenStyle = FullScreenMessageProps['style'];
|
|
9
|
+
declare type ModalStyle = ModalMessageProps['style'];
|
|
10
|
+
export interface MessageDefaultComponents {
|
|
11
|
+
BannerMessage: BannerMessageComponent<BannerStyle>;
|
|
12
|
+
CarouselMessage: CarouselMessageComponent<CarouselStyle>;
|
|
13
|
+
FullScreenMessage: FullScreenMessageComponent<FullScreenStyle>;
|
|
14
|
+
ModalMessage: ModalMessageComponent<ModalStyle>;
|
|
15
|
+
}
|
|
16
|
+
export interface MessageComponents extends Partial<MessageDefaultComponents> {
|
|
17
|
+
}
|
|
18
|
+
export interface InAppMessageDisplayProps {
|
|
19
|
+
/**
|
|
20
|
+
* Message override UI components
|
|
21
|
+
*/
|
|
22
|
+
components?: MessageComponents;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, Text, View } from 'react-native';
|
|
3
|
+
import { icons } from '../../../assets';
|
|
4
|
+
import { Button, IconButton } from '../../../primitives';
|
|
5
|
+
import { ICON_BUTTON_HIT_SLOP, ICON_BUTTON_SIZE, IN_APP_MESSAGING_TEST_ID, } from '../../constants';
|
|
6
|
+
export default function MessageLayout({ orientation, ...props }) {
|
|
7
|
+
const { body, hasButtons, hasPrimaryButton, hasRenderableImage, hasSecondaryButton, header, image, onClose, primaryButton, secondaryButton, styles, } = props;
|
|
8
|
+
const iconButton = (<IconButton color={styles.iconButton.iconColor} hitSlop={ICON_BUTTON_HIT_SLOP} onPress={onClose} size={ICON_BUTTON_SIZE} source={icons.close} style={styles.iconButton.container} testID={IN_APP_MESSAGING_TEST_ID.CLOSE_BUTTON}/>);
|
|
9
|
+
return (<View style={styles.container}>
|
|
10
|
+
<View style={styles.contentContainer}>
|
|
11
|
+
{orientation === 'portrait' && iconButton}
|
|
12
|
+
{hasRenderableImage && (<View style={styles.imageContainer}>
|
|
13
|
+
<Image source={{ uri: image?.src }} style={styles.image} testID={IN_APP_MESSAGING_TEST_ID.IMAGE}/>
|
|
14
|
+
</View>)}
|
|
15
|
+
<View style={styles.textContainer}>
|
|
16
|
+
{header?.content && (<Text style={styles.header} testID={IN_APP_MESSAGING_TEST_ID.HEADER}>
|
|
17
|
+
{header.content}
|
|
18
|
+
</Text>)}
|
|
19
|
+
{body?.content && (<Text style={styles.body} testID={IN_APP_MESSAGING_TEST_ID.BODY}>
|
|
20
|
+
{body.content}
|
|
21
|
+
</Text>)}
|
|
22
|
+
</View>
|
|
23
|
+
{orientation === 'landscape' && iconButton}
|
|
24
|
+
</View>
|
|
25
|
+
{hasButtons && (<View style={styles.buttonsContainer}>
|
|
26
|
+
{hasSecondaryButton && (<Button onPress={secondaryButton?.onAction} style={styles.secondaryButton.container} testID={IN_APP_MESSAGING_TEST_ID.SECONDARY_BUTTON} textStyle={styles.secondaryButton.text}>
|
|
27
|
+
{secondaryButton?.title}
|
|
28
|
+
</Button>)}
|
|
29
|
+
{hasPrimaryButton && (<Button onPress={primaryButton?.onAction} style={styles.primaryButton.container} testID={IN_APP_MESSAGING_TEST_ID.PRIMARY_BUTTON} textStyle={styles.primaryButton.text}>
|
|
30
|
+
{primaryButton?.title}
|
|
31
|
+
</Button>)}
|
|
32
|
+
</View>)}
|
|
33
|
+
</View>);
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MessageLayout } from './MessageLayout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MessageLayout } from './MessageLayout';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MessageComponentBaseProps } from '@aws-amplify/ui-react-core';
|
|
2
|
+
import { DeviceOrientation } from '../../../hooks';
|
|
3
|
+
import { MessageComponentStyles, MessageOverrideStyle, UseMessageProps } from '../../hooks';
|
|
4
|
+
export interface LayoutProps extends Omit<MessageComponentBaseProps<MessageOverrideStyle>, 'style'>, Omit<UseMessageProps, 'shouldRenderMessage' | 'styles'> {
|
|
5
|
+
orientation: DeviceOrientation;
|
|
6
|
+
styles: Omit<MessageComponentStyles, 'wrapper'>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal } from 'react-native';
|
|
3
|
+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
const SUPPORTED_ORIENTATIONS = [
|
|
6
|
+
'portrait',
|
|
7
|
+
'portrait-upside-down',
|
|
8
|
+
'landscape',
|
|
9
|
+
'landscape-left',
|
|
10
|
+
'landscape-right',
|
|
11
|
+
];
|
|
12
|
+
export default function MessageWrapper({ children, disableSafeAreaView, style, }) {
|
|
13
|
+
return (<Modal transparent visible supportedOrientations={SUPPORTED_ORIENTATIONS}>
|
|
14
|
+
<SafeAreaProvider>
|
|
15
|
+
{disableSafeAreaView ? (children) : (<SafeAreaView style={[styles.messageWrapper, style]}>
|
|
16
|
+
{children}
|
|
17
|
+
</SafeAreaView>)}
|
|
18
|
+
</SafeAreaProvider>
|
|
19
|
+
</Modal>);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MessageWrapper } from './MessageWrapper';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface MessageWrapperProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
disableSafeAreaView?: boolean;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
export interface MessageWrapperStyle {
|
|
9
|
+
messageWrapper: ViewStyle;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDeviceOrientation } from '../../../hooks';
|
|
3
|
+
import { useMessageProps } from '../../hooks';
|
|
4
|
+
import { MessageLayout } from '../MessageLayout';
|
|
5
|
+
import { MessageWrapper } from '../MessageWrapper';
|
|
6
|
+
import { getLandscapeStyles, getPortraitStyles } from './styles';
|
|
7
|
+
export default function ModalMessage(props) {
|
|
8
|
+
const { deviceOrientation, isPortraitMode } = useDeviceOrientation();
|
|
9
|
+
const messageProps = useMessageProps(props, isPortraitMode ? getPortraitStyles : getLandscapeStyles);
|
|
10
|
+
const { shouldRenderMessage, styles } = messageProps;
|
|
11
|
+
if (!shouldRenderMessage) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const { wrapper, ...messageStyles } = styles;
|
|
15
|
+
return (<MessageWrapper style={wrapper}>
|
|
16
|
+
<MessageLayout {...props} {...messageProps} orientation={deviceOrientation} styles={messageStyles}/>
|
|
17
|
+
</MessageWrapper>);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ModalMessage } from './ModalMessage';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ImageStyle } from 'react-native';
|
|
2
|
+
import { ModalMessageStyle } from './types';
|
|
3
|
+
export declare const getPortraitStyles: (imageDimensions: ImageStyle) => ModalMessageStyle;
|
|
4
|
+
export declare const getLandscapeStyles: (imageDimensions: ImageStyle) => ModalMessageStyle;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { BORDER_RADIUS_BASE, COLOR_BLACK, COLOR_LIGHT_GREY, COLOR_WHITE, FONT_SIZE_BASE, FONT_SIZE_LARGE, FONT_WEIGHT_BASE, FONT_WEIGHT_BOLD, LINE_HEIGHT_BASE, LINE_HEIGHT_LARGE, MESSAGE_ELEVATION, MESSAGE_SHADOW_HEIGHT, MESSAGE_SHADOW_OPACITY, MESSAGE_SHADOW_RADIUS, MESSAGE_SHADOW_WIDTH, SPACING_EXTRA_LARGE, SPACING_LARGE, SPACING_MEDIUM, SPACING_SMALL, } from '../../constants';
|
|
3
|
+
const commonStyles = {
|
|
4
|
+
body: {
|
|
5
|
+
fontSize: FONT_SIZE_BASE,
|
|
6
|
+
fontWeight: FONT_WEIGHT_BASE,
|
|
7
|
+
lineHeight: LINE_HEIGHT_BASE,
|
|
8
|
+
},
|
|
9
|
+
buttonContainer: {
|
|
10
|
+
backgroundColor: COLOR_LIGHT_GREY,
|
|
11
|
+
borderRadius: BORDER_RADIUS_BASE,
|
|
12
|
+
flex: 1,
|
|
13
|
+
margin: SPACING_MEDIUM,
|
|
14
|
+
padding: SPACING_LARGE,
|
|
15
|
+
},
|
|
16
|
+
buttonsContainer: {
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
},
|
|
20
|
+
container: {
|
|
21
|
+
backgroundColor: COLOR_WHITE,
|
|
22
|
+
elevation: MESSAGE_ELEVATION,
|
|
23
|
+
margin: SPACING_EXTRA_LARGE,
|
|
24
|
+
shadowColor: COLOR_BLACK,
|
|
25
|
+
shadowOffset: {
|
|
26
|
+
width: MESSAGE_SHADOW_WIDTH,
|
|
27
|
+
height: MESSAGE_SHADOW_HEIGHT,
|
|
28
|
+
},
|
|
29
|
+
shadowOpacity: MESSAGE_SHADOW_OPACITY,
|
|
30
|
+
shadowRadius: MESSAGE_SHADOW_RADIUS,
|
|
31
|
+
},
|
|
32
|
+
buttonText: {
|
|
33
|
+
fontSize: FONT_SIZE_BASE,
|
|
34
|
+
fontWeight: FONT_WEIGHT_BASE,
|
|
35
|
+
lineHeight: LINE_HEIGHT_BASE,
|
|
36
|
+
textAlign: 'center',
|
|
37
|
+
},
|
|
38
|
+
header: {
|
|
39
|
+
fontSize: FONT_SIZE_LARGE,
|
|
40
|
+
fontWeight: FONT_WEIGHT_BOLD,
|
|
41
|
+
lineHeight: LINE_HEIGHT_LARGE,
|
|
42
|
+
},
|
|
43
|
+
iconButton: {
|
|
44
|
+
alignSelf: 'flex-start',
|
|
45
|
+
marginLeft: 'auto',
|
|
46
|
+
},
|
|
47
|
+
imageContainer: {
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
margin: SPACING_LARGE,
|
|
50
|
+
},
|
|
51
|
+
wrapper: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const getPortraitStyles = (imageDimensions) => StyleSheet.create({
|
|
57
|
+
...commonStyles,
|
|
58
|
+
buttonsContainer: {
|
|
59
|
+
...commonStyles.buttonsContainer,
|
|
60
|
+
marginTop: 'auto',
|
|
61
|
+
paddingHorizontal: SPACING_SMALL,
|
|
62
|
+
paddingBottom: SPACING_SMALL,
|
|
63
|
+
},
|
|
64
|
+
container: {
|
|
65
|
+
...commonStyles.container,
|
|
66
|
+
minHeight: '40%',
|
|
67
|
+
},
|
|
68
|
+
contentContainer: { padding: SPACING_LARGE },
|
|
69
|
+
image: { ...imageDimensions },
|
|
70
|
+
textContainer: {
|
|
71
|
+
marginTop: SPACING_LARGE,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
export const getLandscapeStyles = (imageDimensions) => StyleSheet.create({
|
|
75
|
+
...commonStyles,
|
|
76
|
+
container: {
|
|
77
|
+
...commonStyles.container,
|
|
78
|
+
flex: 1,
|
|
79
|
+
padding: SPACING_EXTRA_LARGE,
|
|
80
|
+
},
|
|
81
|
+
contentContainer: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
flexDirection: 'row',
|
|
84
|
+
},
|
|
85
|
+
iconButton: {
|
|
86
|
+
...commonStyles.iconButton,
|
|
87
|
+
marginRight: SPACING_MEDIUM,
|
|
88
|
+
},
|
|
89
|
+
image: { ...imageDimensions },
|
|
90
|
+
imageContainer: {
|
|
91
|
+
...commonStyles.imageContainer,
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
},
|
|
94
|
+
textContainer: {
|
|
95
|
+
flex: 1,
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
paddingHorizontal: SPACING_MEDIUM,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModalMessageCommonProps } from '@aws-amplify/ui-react-core';
|
|
2
|
+
import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
|
|
3
|
+
export interface ModalMessageProps extends ModalMessageCommonProps<MessageOverrideStyle | undefined> {
|
|
4
|
+
}
|
|
5
|
+
export interface ModalMessageStyle extends MessageDefaultStyle {
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BannerMessageProps } from './BannerMessage';
|
|
2
|
+
export { CarouselMessageProps } from './CarouselMessage';
|
|
3
|
+
export { FullScreenMessageProps } from './FullScreenMessage';
|
|
4
|
+
export { InAppMessageDisplay, MessageComponents } from './InAppMessageDisplay';
|
|
5
|
+
export { ModalMessageProps } from './ModalMessage';
|
|
6
|
+
export { withInAppMessaging } from './withInAppMessaging';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as withInAppMessaging } from './withInAppMessaging';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as withInAppMessaging } from './withInAppMessaging';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InAppMessagingProvider } from '@aws-amplify/ui-react-core';
|
|
3
|
+
import { InAppMessageDisplay } from '../InAppMessageDisplay';
|
|
4
|
+
export default function withInAppMessaging(Component, options) {
|
|
5
|
+
return function WrappedWithInAppMessaging(props) {
|
|
6
|
+
return (<InAppMessagingProvider>
|
|
7
|
+
<InAppMessageDisplay {...options}/>
|
|
8
|
+
<Component {...props}/>
|
|
9
|
+
</InAppMessagingProvider>);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const COLOR_BLACK = "#000";
|
|
2
|
+
export declare const COLOR_GREY = "#a1a1a1";
|
|
3
|
+
export declare const COLOR_LIGHT_GREY = "#e8e8e8";
|
|
4
|
+
export declare const COLOR_LIGHT_GREY_2 = "#d8d8d8";
|
|
5
|
+
export declare const COLOR_WHITE = "#fff";
|
|
6
|
+
export declare const SPACING_SMALL = 4;
|
|
7
|
+
export declare const SPACING_MEDIUM = 8;
|
|
8
|
+
export declare const SPACING_LARGE = 12;
|
|
9
|
+
export declare const SPACING_EXTRA_LARGE = 16;
|
|
10
|
+
export declare const BORDER_RADIUS_BASE = 4;
|
|
11
|
+
export declare const FONT_SIZE_BASE = 16;
|
|
12
|
+
export declare const FONT_SIZE_LARGE = 18;
|
|
13
|
+
export declare const LINE_HEIGHT_BASE: number;
|
|
14
|
+
export declare const LINE_HEIGHT_LARGE: number;
|
|
15
|
+
export declare const FONT_WEIGHT_BASE = "400";
|
|
16
|
+
export declare const FONT_WEIGHT_BOLD = "600";
|
|
17
|
+
export declare const ICON_BUTTON_SIZE = 20;
|
|
18
|
+
export declare const ICON_BUTTON_HIT_SLOP = 10;
|
|
19
|
+
export declare const MESSAGE_SHADOW_HEIGHT = 2;
|
|
20
|
+
export declare const MESSAGE_SHADOW_WIDTH = 2;
|
|
21
|
+
export declare const MESSAGE_SHADOW_OPACITY = 0.1;
|
|
22
|
+
export declare const MESSAGE_SHADOW_RADIUS = 2;
|
|
23
|
+
export declare const MESSAGE_ELEVATION = 3;
|
|
24
|
+
export declare const BUTTON_PRESSED_OPACITY = 0.8;
|
|
25
|
+
export declare const IN_APP_MESSAGING_TEST_ID: {
|
|
26
|
+
BODY: string;
|
|
27
|
+
CLOSE_BUTTON: string;
|
|
28
|
+
HEADER: string;
|
|
29
|
+
IMAGE: string;
|
|
30
|
+
PRIMARY_BUTTON: string;
|
|
31
|
+
SECONDARY_BUTTON: string;
|
|
32
|
+
};
|