@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,75 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
PressableStateCallbackType,
|
|
5
|
+
StyleProp,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
|
|
10
|
+
import { Label } from '../Label';
|
|
11
|
+
import { getFlexDirectionFromLabelPosition } from '../Label/utils';
|
|
12
|
+
|
|
13
|
+
import { styles } from './styles';
|
|
14
|
+
import { RadioProps } from './types';
|
|
15
|
+
import { getRadioDimensions } from './getRadioDimensions';
|
|
16
|
+
|
|
17
|
+
export default function Radio<T>({
|
|
18
|
+
accessibilityRole = 'radio',
|
|
19
|
+
disabled,
|
|
20
|
+
label,
|
|
21
|
+
labelPosition = 'end',
|
|
22
|
+
labelStyle,
|
|
23
|
+
onChange,
|
|
24
|
+
radioContainerStyle,
|
|
25
|
+
radioDotStyle,
|
|
26
|
+
selected,
|
|
27
|
+
size = 'medium',
|
|
28
|
+
style,
|
|
29
|
+
value,
|
|
30
|
+
...rest
|
|
31
|
+
}: RadioProps<T>): JSX.Element {
|
|
32
|
+
const handleOnChange = useCallback(() => {
|
|
33
|
+
if (!disabled) {
|
|
34
|
+
onChange?.(value);
|
|
35
|
+
}
|
|
36
|
+
}, [onChange, value, disabled]);
|
|
37
|
+
|
|
38
|
+
const containerStyle = useCallback(
|
|
39
|
+
({ pressed }: PressableStateCallbackType): StyleProp<ViewStyle> => {
|
|
40
|
+
const containerStyle: ViewStyle = {
|
|
41
|
+
...styles.container,
|
|
42
|
+
flexDirection: getFlexDirectionFromLabelPosition(labelPosition),
|
|
43
|
+
...(disabled && styles.disabled),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const pressedStateStyle =
|
|
47
|
+
typeof style === 'function' ? style({ pressed }) : style;
|
|
48
|
+
return [containerStyle, pressedStateStyle];
|
|
49
|
+
},
|
|
50
|
+
[disabled, labelPosition, style]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const { radioContainerSize, radioDotSize } = useMemo(
|
|
54
|
+
() => getRadioDimensions(size, styles),
|
|
55
|
+
[size]
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Pressable
|
|
60
|
+
{...rest}
|
|
61
|
+
accessibilityRole={accessibilityRole}
|
|
62
|
+
onPress={handleOnChange}
|
|
63
|
+
style={containerStyle}
|
|
64
|
+
>
|
|
65
|
+
<View
|
|
66
|
+
style={[styles.radioContainer, radioContainerSize, radioContainerStyle]}
|
|
67
|
+
>
|
|
68
|
+
{selected ? (
|
|
69
|
+
<View style={[styles.radioDot, radioDotSize, radioDotStyle]} />
|
|
70
|
+
) : null}
|
|
71
|
+
</View>
|
|
72
|
+
{label ? <Label style={labelStyle}>{label}</Label> : null}
|
|
73
|
+
</Pressable>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react-native';
|
|
3
|
+
import Radio from '../Radio';
|
|
4
|
+
import { Size } from '../types';
|
|
5
|
+
|
|
6
|
+
const sizes: Size[] = ['small', 'medium', 'large'];
|
|
7
|
+
|
|
8
|
+
const onChange = jest.fn();
|
|
9
|
+
|
|
10
|
+
describe('Radio', () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
onChange.mockClear();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it.each([true, false])('renders as expected when selected is %s', (value) => {
|
|
16
|
+
const { toJSON } = render(
|
|
17
|
+
<Radio
|
|
18
|
+
selected={value}
|
|
19
|
+
value={value}
|
|
20
|
+
label={`${value}`}
|
|
21
|
+
onChange={onChange}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
expect(toJSON()).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('calls the expected handler when selected', () => {
|
|
28
|
+
const { getByRole } = render(<Radio value="" onChange={onChange} />);
|
|
29
|
+
const radio = getByRole('radio');
|
|
30
|
+
fireEvent.press(radio);
|
|
31
|
+
expect(onChange).toHaveBeenCalledTimes(1);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it.each(sizes)('renders as expected when size is %s', (value) => {
|
|
35
|
+
const { toJSON } = render(
|
|
36
|
+
<Radio size={value} value={value} label={`${value}`} selected />
|
|
37
|
+
);
|
|
38
|
+
expect(toJSON()).toMatchSnapshot();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('renders as expected when passing a number to the size prop', () => {
|
|
42
|
+
const { toJSON } = render(
|
|
43
|
+
<Radio size={40} value="number" label="number" selected />
|
|
44
|
+
);
|
|
45
|
+
expect(toJSON()).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('renders as expected with accessibilityRole', () => {
|
|
49
|
+
const { toJSON } = render(
|
|
50
|
+
<Radio value="" onChange={onChange} accessibilityRole={'none'} />
|
|
51
|
+
);
|
|
52
|
+
expect(toJSON()).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders as expected when disabled', () => {
|
|
56
|
+
const { toJSON } = render(
|
|
57
|
+
<Radio disabled value="disabled" label="disabled" onChange={onChange} />
|
|
58
|
+
);
|
|
59
|
+
expect(toJSON()).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('does nothing when disabled', () => {
|
|
63
|
+
const { getByRole } = render(
|
|
64
|
+
<Radio disabled value="disabled" label="disabled" onChange={onChange} />
|
|
65
|
+
);
|
|
66
|
+
const radio = getByRole('radio');
|
|
67
|
+
fireEvent.press(radio);
|
|
68
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Radio renders as expected when disabled 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityRole="radio"
|
|
6
|
+
accessible={true}
|
|
7
|
+
collapsable={false}
|
|
8
|
+
focusable={true}
|
|
9
|
+
onBlur={[Function]}
|
|
10
|
+
onClick={[Function]}
|
|
11
|
+
onFocus={[Function]}
|
|
12
|
+
onResponderGrant={[Function]}
|
|
13
|
+
onResponderMove={[Function]}
|
|
14
|
+
onResponderRelease={[Function]}
|
|
15
|
+
onResponderTerminate={[Function]}
|
|
16
|
+
onResponderTerminationRequest={[Function]}
|
|
17
|
+
onStartShouldSetResponder={[Function]}
|
|
18
|
+
style={
|
|
19
|
+
Array [
|
|
20
|
+
Object {
|
|
21
|
+
"alignItems": "center",
|
|
22
|
+
"flexDirection": "row",
|
|
23
|
+
"opacity": 0.6,
|
|
24
|
+
},
|
|
25
|
+
undefined,
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
>
|
|
29
|
+
<View
|
|
30
|
+
style={
|
|
31
|
+
Array [
|
|
32
|
+
Object {
|
|
33
|
+
"alignItems": "center",
|
|
34
|
+
"borderColor": "#317d95",
|
|
35
|
+
"borderRadius": 999,
|
|
36
|
+
"borderWidth": 2,
|
|
37
|
+
"justifyContent": "center",
|
|
38
|
+
},
|
|
39
|
+
Object {
|
|
40
|
+
"height": 20,
|
|
41
|
+
"width": 20,
|
|
42
|
+
},
|
|
43
|
+
undefined,
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
<Text
|
|
48
|
+
accessibilityRole="text"
|
|
49
|
+
style={
|
|
50
|
+
Array [
|
|
51
|
+
Object {
|
|
52
|
+
"fontSize": 16,
|
|
53
|
+
"marginHorizontal": 4,
|
|
54
|
+
"marginVertical": 2,
|
|
55
|
+
},
|
|
56
|
+
undefined,
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
disabled
|
|
61
|
+
</Text>
|
|
62
|
+
</View>
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`Radio renders as expected when passing a number to the size prop 1`] = `
|
|
66
|
+
<View
|
|
67
|
+
accessibilityRole="radio"
|
|
68
|
+
accessible={true}
|
|
69
|
+
collapsable={false}
|
|
70
|
+
focusable={true}
|
|
71
|
+
onBlur={[Function]}
|
|
72
|
+
onClick={[Function]}
|
|
73
|
+
onFocus={[Function]}
|
|
74
|
+
onResponderGrant={[Function]}
|
|
75
|
+
onResponderMove={[Function]}
|
|
76
|
+
onResponderRelease={[Function]}
|
|
77
|
+
onResponderTerminate={[Function]}
|
|
78
|
+
onResponderTerminationRequest={[Function]}
|
|
79
|
+
onStartShouldSetResponder={[Function]}
|
|
80
|
+
style={
|
|
81
|
+
Array [
|
|
82
|
+
Object {
|
|
83
|
+
"alignItems": "center",
|
|
84
|
+
"flexDirection": "row",
|
|
85
|
+
},
|
|
86
|
+
undefined,
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
<View
|
|
91
|
+
style={
|
|
92
|
+
Array [
|
|
93
|
+
Object {
|
|
94
|
+
"alignItems": "center",
|
|
95
|
+
"borderColor": "#317d95",
|
|
96
|
+
"borderRadius": 999,
|
|
97
|
+
"borderWidth": 2,
|
|
98
|
+
"justifyContent": "center",
|
|
99
|
+
},
|
|
100
|
+
Object {
|
|
101
|
+
"height": 40,
|
|
102
|
+
"width": 40,
|
|
103
|
+
},
|
|
104
|
+
undefined,
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
<View
|
|
109
|
+
style={
|
|
110
|
+
Array [
|
|
111
|
+
Object {
|
|
112
|
+
"backgroundColor": "#317d95",
|
|
113
|
+
"borderRadius": 999,
|
|
114
|
+
},
|
|
115
|
+
Object {
|
|
116
|
+
"height": 20,
|
|
117
|
+
"width": 20,
|
|
118
|
+
},
|
|
119
|
+
undefined,
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
/>
|
|
123
|
+
</View>
|
|
124
|
+
<Text
|
|
125
|
+
accessibilityRole="text"
|
|
126
|
+
style={
|
|
127
|
+
Array [
|
|
128
|
+
Object {
|
|
129
|
+
"fontSize": 16,
|
|
130
|
+
"marginHorizontal": 4,
|
|
131
|
+
"marginVertical": 2,
|
|
132
|
+
},
|
|
133
|
+
undefined,
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
>
|
|
137
|
+
number
|
|
138
|
+
</Text>
|
|
139
|
+
</View>
|
|
140
|
+
`;
|
|
141
|
+
|
|
142
|
+
exports[`Radio renders as expected when selected is false 1`] = `
|
|
143
|
+
<View
|
|
144
|
+
accessibilityRole="radio"
|
|
145
|
+
accessible={true}
|
|
146
|
+
collapsable={false}
|
|
147
|
+
focusable={true}
|
|
148
|
+
onBlur={[Function]}
|
|
149
|
+
onClick={[Function]}
|
|
150
|
+
onFocus={[Function]}
|
|
151
|
+
onResponderGrant={[Function]}
|
|
152
|
+
onResponderMove={[Function]}
|
|
153
|
+
onResponderRelease={[Function]}
|
|
154
|
+
onResponderTerminate={[Function]}
|
|
155
|
+
onResponderTerminationRequest={[Function]}
|
|
156
|
+
onStartShouldSetResponder={[Function]}
|
|
157
|
+
style={
|
|
158
|
+
Array [
|
|
159
|
+
Object {
|
|
160
|
+
"alignItems": "center",
|
|
161
|
+
"flexDirection": "row",
|
|
162
|
+
},
|
|
163
|
+
undefined,
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
>
|
|
167
|
+
<View
|
|
168
|
+
style={
|
|
169
|
+
Array [
|
|
170
|
+
Object {
|
|
171
|
+
"alignItems": "center",
|
|
172
|
+
"borderColor": "#317d95",
|
|
173
|
+
"borderRadius": 999,
|
|
174
|
+
"borderWidth": 2,
|
|
175
|
+
"justifyContent": "center",
|
|
176
|
+
},
|
|
177
|
+
Object {
|
|
178
|
+
"height": 20,
|
|
179
|
+
"width": 20,
|
|
180
|
+
},
|
|
181
|
+
undefined,
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
/>
|
|
185
|
+
<Text
|
|
186
|
+
accessibilityRole="text"
|
|
187
|
+
style={
|
|
188
|
+
Array [
|
|
189
|
+
Object {
|
|
190
|
+
"fontSize": 16,
|
|
191
|
+
"marginHorizontal": 4,
|
|
192
|
+
"marginVertical": 2,
|
|
193
|
+
},
|
|
194
|
+
undefined,
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
>
|
|
198
|
+
false
|
|
199
|
+
</Text>
|
|
200
|
+
</View>
|
|
201
|
+
`;
|
|
202
|
+
|
|
203
|
+
exports[`Radio renders as expected when selected is true 1`] = `
|
|
204
|
+
<View
|
|
205
|
+
accessibilityRole="radio"
|
|
206
|
+
accessible={true}
|
|
207
|
+
collapsable={false}
|
|
208
|
+
focusable={true}
|
|
209
|
+
onBlur={[Function]}
|
|
210
|
+
onClick={[Function]}
|
|
211
|
+
onFocus={[Function]}
|
|
212
|
+
onResponderGrant={[Function]}
|
|
213
|
+
onResponderMove={[Function]}
|
|
214
|
+
onResponderRelease={[Function]}
|
|
215
|
+
onResponderTerminate={[Function]}
|
|
216
|
+
onResponderTerminationRequest={[Function]}
|
|
217
|
+
onStartShouldSetResponder={[Function]}
|
|
218
|
+
style={
|
|
219
|
+
Array [
|
|
220
|
+
Object {
|
|
221
|
+
"alignItems": "center",
|
|
222
|
+
"flexDirection": "row",
|
|
223
|
+
},
|
|
224
|
+
undefined,
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
>
|
|
228
|
+
<View
|
|
229
|
+
style={
|
|
230
|
+
Array [
|
|
231
|
+
Object {
|
|
232
|
+
"alignItems": "center",
|
|
233
|
+
"borderColor": "#317d95",
|
|
234
|
+
"borderRadius": 999,
|
|
235
|
+
"borderWidth": 2,
|
|
236
|
+
"justifyContent": "center",
|
|
237
|
+
},
|
|
238
|
+
Object {
|
|
239
|
+
"height": 20,
|
|
240
|
+
"width": 20,
|
|
241
|
+
},
|
|
242
|
+
undefined,
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
>
|
|
246
|
+
<View
|
|
247
|
+
style={
|
|
248
|
+
Array [
|
|
249
|
+
Object {
|
|
250
|
+
"backgroundColor": "#317d95",
|
|
251
|
+
"borderRadius": 999,
|
|
252
|
+
},
|
|
253
|
+
Object {
|
|
254
|
+
"height": 10,
|
|
255
|
+
"width": 10,
|
|
256
|
+
},
|
|
257
|
+
undefined,
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
/>
|
|
261
|
+
</View>
|
|
262
|
+
<Text
|
|
263
|
+
accessibilityRole="text"
|
|
264
|
+
style={
|
|
265
|
+
Array [
|
|
266
|
+
Object {
|
|
267
|
+
"fontSize": 16,
|
|
268
|
+
"marginHorizontal": 4,
|
|
269
|
+
"marginVertical": 2,
|
|
270
|
+
},
|
|
271
|
+
undefined,
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
>
|
|
275
|
+
true
|
|
276
|
+
</Text>
|
|
277
|
+
</View>
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
exports[`Radio renders as expected when size is large 1`] = `
|
|
281
|
+
<View
|
|
282
|
+
accessibilityRole="radio"
|
|
283
|
+
accessible={true}
|
|
284
|
+
collapsable={false}
|
|
285
|
+
focusable={true}
|
|
286
|
+
onBlur={[Function]}
|
|
287
|
+
onClick={[Function]}
|
|
288
|
+
onFocus={[Function]}
|
|
289
|
+
onResponderGrant={[Function]}
|
|
290
|
+
onResponderMove={[Function]}
|
|
291
|
+
onResponderRelease={[Function]}
|
|
292
|
+
onResponderTerminate={[Function]}
|
|
293
|
+
onResponderTerminationRequest={[Function]}
|
|
294
|
+
onStartShouldSetResponder={[Function]}
|
|
295
|
+
style={
|
|
296
|
+
Array [
|
|
297
|
+
Object {
|
|
298
|
+
"alignItems": "center",
|
|
299
|
+
"flexDirection": "row",
|
|
300
|
+
},
|
|
301
|
+
undefined,
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
>
|
|
305
|
+
<View
|
|
306
|
+
style={
|
|
307
|
+
Array [
|
|
308
|
+
Object {
|
|
309
|
+
"alignItems": "center",
|
|
310
|
+
"borderColor": "#317d95",
|
|
311
|
+
"borderRadius": 999,
|
|
312
|
+
"borderWidth": 2,
|
|
313
|
+
"justifyContent": "center",
|
|
314
|
+
},
|
|
315
|
+
Object {
|
|
316
|
+
"height": 24,
|
|
317
|
+
"width": 24,
|
|
318
|
+
},
|
|
319
|
+
undefined,
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
>
|
|
323
|
+
<View
|
|
324
|
+
style={
|
|
325
|
+
Array [
|
|
326
|
+
Object {
|
|
327
|
+
"backgroundColor": "#317d95",
|
|
328
|
+
"borderRadius": 999,
|
|
329
|
+
},
|
|
330
|
+
Object {
|
|
331
|
+
"height": 12,
|
|
332
|
+
"width": 12,
|
|
333
|
+
},
|
|
334
|
+
undefined,
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
/>
|
|
338
|
+
</View>
|
|
339
|
+
<Text
|
|
340
|
+
accessibilityRole="text"
|
|
341
|
+
style={
|
|
342
|
+
Array [
|
|
343
|
+
Object {
|
|
344
|
+
"fontSize": 16,
|
|
345
|
+
"marginHorizontal": 4,
|
|
346
|
+
"marginVertical": 2,
|
|
347
|
+
},
|
|
348
|
+
undefined,
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
>
|
|
352
|
+
large
|
|
353
|
+
</Text>
|
|
354
|
+
</View>
|
|
355
|
+
`;
|
|
356
|
+
|
|
357
|
+
exports[`Radio renders as expected when size is medium 1`] = `
|
|
358
|
+
<View
|
|
359
|
+
accessibilityRole="radio"
|
|
360
|
+
accessible={true}
|
|
361
|
+
collapsable={false}
|
|
362
|
+
focusable={true}
|
|
363
|
+
onBlur={[Function]}
|
|
364
|
+
onClick={[Function]}
|
|
365
|
+
onFocus={[Function]}
|
|
366
|
+
onResponderGrant={[Function]}
|
|
367
|
+
onResponderMove={[Function]}
|
|
368
|
+
onResponderRelease={[Function]}
|
|
369
|
+
onResponderTerminate={[Function]}
|
|
370
|
+
onResponderTerminationRequest={[Function]}
|
|
371
|
+
onStartShouldSetResponder={[Function]}
|
|
372
|
+
style={
|
|
373
|
+
Array [
|
|
374
|
+
Object {
|
|
375
|
+
"alignItems": "center",
|
|
376
|
+
"flexDirection": "row",
|
|
377
|
+
},
|
|
378
|
+
undefined,
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
>
|
|
382
|
+
<View
|
|
383
|
+
style={
|
|
384
|
+
Array [
|
|
385
|
+
Object {
|
|
386
|
+
"alignItems": "center",
|
|
387
|
+
"borderColor": "#317d95",
|
|
388
|
+
"borderRadius": 999,
|
|
389
|
+
"borderWidth": 2,
|
|
390
|
+
"justifyContent": "center",
|
|
391
|
+
},
|
|
392
|
+
Object {
|
|
393
|
+
"height": 20,
|
|
394
|
+
"width": 20,
|
|
395
|
+
},
|
|
396
|
+
undefined,
|
|
397
|
+
]
|
|
398
|
+
}
|
|
399
|
+
>
|
|
400
|
+
<View
|
|
401
|
+
style={
|
|
402
|
+
Array [
|
|
403
|
+
Object {
|
|
404
|
+
"backgroundColor": "#317d95",
|
|
405
|
+
"borderRadius": 999,
|
|
406
|
+
},
|
|
407
|
+
Object {
|
|
408
|
+
"height": 10,
|
|
409
|
+
"width": 10,
|
|
410
|
+
},
|
|
411
|
+
undefined,
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
/>
|
|
415
|
+
</View>
|
|
416
|
+
<Text
|
|
417
|
+
accessibilityRole="text"
|
|
418
|
+
style={
|
|
419
|
+
Array [
|
|
420
|
+
Object {
|
|
421
|
+
"fontSize": 16,
|
|
422
|
+
"marginHorizontal": 4,
|
|
423
|
+
"marginVertical": 2,
|
|
424
|
+
},
|
|
425
|
+
undefined,
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
>
|
|
429
|
+
medium
|
|
430
|
+
</Text>
|
|
431
|
+
</View>
|
|
432
|
+
`;
|
|
433
|
+
|
|
434
|
+
exports[`Radio renders as expected when size is small 1`] = `
|
|
435
|
+
<View
|
|
436
|
+
accessibilityRole="radio"
|
|
437
|
+
accessible={true}
|
|
438
|
+
collapsable={false}
|
|
439
|
+
focusable={true}
|
|
440
|
+
onBlur={[Function]}
|
|
441
|
+
onClick={[Function]}
|
|
442
|
+
onFocus={[Function]}
|
|
443
|
+
onResponderGrant={[Function]}
|
|
444
|
+
onResponderMove={[Function]}
|
|
445
|
+
onResponderRelease={[Function]}
|
|
446
|
+
onResponderTerminate={[Function]}
|
|
447
|
+
onResponderTerminationRequest={[Function]}
|
|
448
|
+
onStartShouldSetResponder={[Function]}
|
|
449
|
+
style={
|
|
450
|
+
Array [
|
|
451
|
+
Object {
|
|
452
|
+
"alignItems": "center",
|
|
453
|
+
"flexDirection": "row",
|
|
454
|
+
},
|
|
455
|
+
undefined,
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
>
|
|
459
|
+
<View
|
|
460
|
+
style={
|
|
461
|
+
Array [
|
|
462
|
+
Object {
|
|
463
|
+
"alignItems": "center",
|
|
464
|
+
"borderColor": "#317d95",
|
|
465
|
+
"borderRadius": 999,
|
|
466
|
+
"borderWidth": 2,
|
|
467
|
+
"justifyContent": "center",
|
|
468
|
+
},
|
|
469
|
+
Object {
|
|
470
|
+
"height": 16,
|
|
471
|
+
"width": 16,
|
|
472
|
+
},
|
|
473
|
+
undefined,
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
>
|
|
477
|
+
<View
|
|
478
|
+
style={
|
|
479
|
+
Array [
|
|
480
|
+
Object {
|
|
481
|
+
"backgroundColor": "#317d95",
|
|
482
|
+
"borderRadius": 999,
|
|
483
|
+
},
|
|
484
|
+
Object {
|
|
485
|
+
"height": 8,
|
|
486
|
+
"width": 8,
|
|
487
|
+
},
|
|
488
|
+
undefined,
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
/>
|
|
492
|
+
</View>
|
|
493
|
+
<Text
|
|
494
|
+
accessibilityRole="text"
|
|
495
|
+
style={
|
|
496
|
+
Array [
|
|
497
|
+
Object {
|
|
498
|
+
"fontSize": 16,
|
|
499
|
+
"marginHorizontal": 4,
|
|
500
|
+
"marginVertical": 2,
|
|
501
|
+
},
|
|
502
|
+
undefined,
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
>
|
|
506
|
+
small
|
|
507
|
+
</Text>
|
|
508
|
+
</View>
|
|
509
|
+
`;
|
|
510
|
+
|
|
511
|
+
exports[`Radio renders as expected with accessibilityRole 1`] = `
|
|
512
|
+
<View
|
|
513
|
+
accessibilityRole="none"
|
|
514
|
+
accessible={true}
|
|
515
|
+
collapsable={false}
|
|
516
|
+
focusable={true}
|
|
517
|
+
onBlur={[Function]}
|
|
518
|
+
onClick={[Function]}
|
|
519
|
+
onFocus={[Function]}
|
|
520
|
+
onResponderGrant={[Function]}
|
|
521
|
+
onResponderMove={[Function]}
|
|
522
|
+
onResponderRelease={[Function]}
|
|
523
|
+
onResponderTerminate={[Function]}
|
|
524
|
+
onResponderTerminationRequest={[Function]}
|
|
525
|
+
onStartShouldSetResponder={[Function]}
|
|
526
|
+
style={
|
|
527
|
+
Array [
|
|
528
|
+
Object {
|
|
529
|
+
"alignItems": "center",
|
|
530
|
+
"flexDirection": "row",
|
|
531
|
+
},
|
|
532
|
+
undefined,
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
>
|
|
536
|
+
<View
|
|
537
|
+
style={
|
|
538
|
+
Array [
|
|
539
|
+
Object {
|
|
540
|
+
"alignItems": "center",
|
|
541
|
+
"borderColor": "#317d95",
|
|
542
|
+
"borderRadius": 999,
|
|
543
|
+
"borderWidth": 2,
|
|
544
|
+
"justifyContent": "center",
|
|
545
|
+
},
|
|
546
|
+
Object {
|
|
547
|
+
"height": 20,
|
|
548
|
+
"width": 20,
|
|
549
|
+
},
|
|
550
|
+
undefined,
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
/>
|
|
554
|
+
</View>
|
|
555
|
+
`;
|