@aic-kits/react-native 0.0.2 → 0.0.4
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/lib/auth/components/SocialAuthButton/constants.d.ts +7 -0
- package/lib/auth/components/SocialAuthButton/constants.d.ts.map +1 -0
- package/lib/auth/components/SocialAuthButton/constants.js +14 -0
- package/lib/auth/components/SocialAuthButton/index.d.ts +22 -0
- package/lib/auth/components/SocialAuthButton/index.d.ts.map +1 -0
- package/lib/auth/components/SocialAuthButton/index.js +37 -0
- package/lib/auth/components/SocialSignIn/constants.d.ts +3 -0
- package/lib/auth/components/SocialSignIn/constants.d.ts.map +1 -0
- package/lib/auth/components/SocialSignIn/constants.js +1 -0
- package/lib/auth/components/SocialSignIn/index.d.ts +16 -0
- package/lib/auth/components/SocialSignIn/index.d.ts.map +1 -0
- package/lib/auth/components/SocialSignIn/index.js +11 -0
- package/lib/auth/components/index.d.ts +3 -0
- package/lib/auth/components/index.d.ts.map +1 -0
- package/lib/auth/components/index.js +2 -0
- package/lib/auth/hooks/index.d.ts +2 -0
- package/lib/auth/hooks/index.d.ts.map +1 -0
- package/lib/auth/hooks/index.js +1 -0
- package/lib/auth/hooks/useAuthListener.d.ts +6 -0
- package/lib/auth/hooks/useAuthListener.d.ts.map +1 -0
- package/lib/auth/hooks/useAuthListener.js +40 -0
- package/lib/auth/index.d.ts +7 -0
- package/lib/auth/index.d.ts.map +1 -0
- package/lib/auth/index.js +6 -0
- package/lib/auth/types.d.ts +26 -0
- package/lib/auth/types.d.ts.map +1 -0
- package/lib/auth/types.js +1 -0
- package/lib/auth/utils/apple.d.ts +4 -0
- package/lib/auth/utils/apple.d.ts.map +1 -0
- package/lib/auth/utils/apple.js +90 -0
- package/lib/auth/utils/email.d.ts +11 -0
- package/lib/auth/utils/email.d.ts.map +1 -0
- package/lib/auth/utils/email.js +33 -0
- package/lib/auth/utils/facebook.d.ts +4 -0
- package/lib/auth/utils/facebook.d.ts.map +1 -0
- package/lib/auth/utils/facebook.js +59 -0
- package/lib/auth/utils/google.d.ts +3 -0
- package/lib/auth/utils/google.d.ts.map +1 -0
- package/lib/auth/utils/google.js +33 -0
- package/lib/auth/utils/index.d.ts +8 -0
- package/lib/auth/utils/index.d.ts.map +1 -0
- package/lib/auth/utils/index.js +55 -0
- package/lib/components/Art/BrandArt.d.ts +3 -0
- package/lib/components/Art/BrandArt.d.ts.map +1 -0
- package/lib/components/Art/BrandArt.js +6 -0
- package/lib/components/Art/EmojiArt.d.ts +3 -0
- package/lib/components/Art/EmojiArt.d.ts.map +1 -0
- package/lib/components/Art/EmojiArt.js +25 -0
- package/lib/components/Art/IconArt.d.ts +3 -0
- package/lib/components/Art/IconArt.d.ts.map +1 -0
- package/lib/components/Art/IconArt.js +26 -0
- package/lib/components/Art/ImageArt.d.ts +3 -0
- package/lib/components/Art/ImageArt.d.ts.map +1 -0
- package/lib/components/Art/ImageArt.js +24 -0
- package/lib/components/Art/SvgArt.d.ts +3 -0
- package/lib/components/Art/SvgArt.d.ts.map +1 -0
- package/lib/components/Art/SvgArt.js +51 -0
- package/lib/components/Art/constants.d.ts +5 -0
- package/lib/components/Art/constants.d.ts.map +1 -0
- package/lib/components/Art/constants.js +6 -0
- package/lib/components/Art/hooks.d.ts +3 -0
- package/lib/components/Art/hooks.d.ts.map +1 -0
- package/lib/components/Art/hooks.js +8 -0
- package/lib/components/Art/index.d.ts +10 -0
- package/lib/components/Art/index.d.ts.map +1 -0
- package/lib/components/Art/index.js +29 -0
- package/lib/components/Art/types.d.ts +157 -0
- package/lib/components/Art/types.d.ts.map +1 -0
- package/lib/components/Art/types.js +1 -0
- package/lib/components/Art/utils.d.ts +40 -0
- package/lib/components/Art/utils.d.ts.map +1 -0
- package/lib/components/Art/utils.js +68 -0
- package/lib/components/Avatar/Wrapper.d.ts +11 -0
- package/lib/components/Avatar/Wrapper.d.ts.map +1 -0
- package/lib/components/Avatar/Wrapper.js +67 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.d.ts +14 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.d.ts.map +1 -0
- package/lib/components/Avatar/apiCalls/useUploadCloudinaryImageApi.js +24 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/Avatar/index.d.ts.map +1 -0
- package/lib/components/Avatar/index.js +37 -0
- package/lib/components/Avatar/types.d.ts +51 -0
- package/lib/components/Avatar/types.d.ts.map +1 -0
- package/lib/components/Avatar/types.js +1 -0
- package/lib/components/Avatar/utils.d.ts +6 -0
- package/lib/components/Avatar/utils.d.ts.map +1 -0
- package/lib/components/Avatar/utils.js +9 -0
- package/lib/components/Base/BaseFooter.d.ts +8 -0
- package/lib/components/Base/BaseFooter.d.ts.map +1 -0
- package/lib/components/Base/BaseFooter.js +18 -0
- package/lib/components/Base/index.d.ts +4 -0
- package/lib/components/Base/index.d.ts.map +1 -0
- package/lib/components/Base/index.js +49 -0
- package/lib/components/Base/types.d.ts +83 -0
- package/lib/components/Base/types.d.ts.map +1 -0
- package/lib/components/Base/types.js +1 -0
- package/lib/components/Box/StyledBox.d.ts +254 -0
- package/lib/components/Box/StyledBox.d.ts.map +1 -0
- package/lib/components/Box/StyledBox.js +53 -0
- package/lib/components/Box/config.d.ts +359 -0
- package/lib/components/Box/config.d.ts.map +1 -0
- package/lib/components/Box/config.js +227 -0
- package/lib/components/Box/index.d.ts +11 -0
- package/lib/components/Box/index.d.ts.map +1 -0
- package/lib/components/Box/index.js +14 -0
- package/lib/components/Box/types.d.ts +53 -0
- package/lib/components/Box/types.d.ts.map +1 -0
- package/lib/components/Box/types.js +1 -0
- package/lib/components/Bubble/index.d.ts +8 -0
- package/lib/components/Bubble/index.d.ts.map +1 -0
- package/lib/components/Bubble/index.js +20 -0
- package/lib/components/Bubble/type.d.ts +18 -0
- package/lib/components/Bubble/type.d.ts.map +1 -0
- package/lib/components/Bubble/type.js +1 -0
- package/lib/components/Bubble/utils.d.ts +12 -0
- package/lib/components/Bubble/utils.d.ts.map +1 -0
- package/lib/components/Bubble/utils.js +33 -0
- package/lib/components/Button/StyledButton.d.ts +34 -0
- package/lib/components/Button/StyledButton.d.ts.map +1 -0
- package/lib/components/Button/StyledButton.js +49 -0
- package/lib/components/Button/index.d.ts +64 -0
- package/lib/components/Button/index.d.ts.map +1 -0
- package/lib/components/Button/index.js +20 -0
- package/lib/components/Button/utils.d.ts +4 -0
- package/lib/components/Button/utils.d.ts.map +1 -0
- package/lib/components/Button/utils.js +10 -0
- package/lib/components/Card/StyledCard.d.ts +226 -0
- package/lib/components/Card/StyledCard.d.ts.map +1 -0
- package/lib/components/Card/StyledCard.js +17 -0
- package/lib/components/Card/index.d.ts +27 -0
- package/lib/components/Card/index.d.ts.map +1 -0
- package/lib/components/Card/index.js +44 -0
- package/lib/components/Chart/LineChart.d.ts +3 -0
- package/lib/components/Chart/LineChart.d.ts.map +1 -0
- package/lib/components/Chart/LineChart.js +27 -0
- package/lib/components/Chart/constants.d.ts +2 -0
- package/lib/components/Chart/constants.d.ts.map +1 -0
- package/lib/components/Chart/constants.js +47 -0
- package/lib/components/Chart/index.d.ts +3 -0
- package/lib/components/Chart/index.d.ts.map +1 -0
- package/lib/components/Chart/index.js +10 -0
- package/lib/components/Chart/types.d.ts +32 -0
- package/lib/components/Chart/types.d.ts.map +1 -0
- package/lib/components/Chart/types.js +1 -0
- package/lib/components/Chart/utils.d.ts +6 -0
- package/lib/components/Chart/utils.d.ts.map +1 -0
- package/lib/components/Chart/utils.js +8 -0
- package/lib/components/Chat/ImageChat.d.ts +8 -0
- package/lib/components/Chat/ImageChat.d.ts.map +1 -0
- package/lib/components/Chat/ImageChat.js +24 -0
- package/lib/components/Chat/TextChat.d.ts +8 -0
- package/lib/components/Chat/TextChat.d.ts.map +1 -0
- package/lib/components/Chat/TextChat.js +37 -0
- package/lib/components/Chat/VideoChat.d.ts +6 -0
- package/lib/components/Chat/VideoChat.d.ts.map +1 -0
- package/lib/components/Chat/VideoChat.js +56 -0
- package/lib/components/Chat/index.d.ts +4 -0
- package/lib/components/Chat/index.d.ts.map +1 -0
- package/lib/components/Chat/index.js +26 -0
- package/lib/components/Chat/type.d.ts +95 -0
- package/lib/components/Chat/type.d.ts.map +1 -0
- package/lib/components/Chat/type.js +1 -0
- package/lib/components/ChatCluster/index.d.ts +4 -0
- package/lib/components/ChatCluster/index.d.ts.map +1 -0
- package/lib/components/ChatCluster/index.js +22 -0
- package/lib/components/ChatCluster/types.d.ts +11 -0
- package/lib/components/ChatCluster/types.d.ts.map +1 -0
- package/lib/components/ChatCluster/types.js +1 -0
- package/lib/components/ChatCluster/utils.d.ts +5 -0
- package/lib/components/ChatCluster/utils.d.ts.map +1 -0
- package/lib/components/ChatCluster/utils.js +15 -0
- package/lib/components/Chip/index.d.ts +3 -0
- package/lib/components/Chip/index.d.ts.map +1 -0
- package/lib/components/Chip/index.js +16 -0
- package/lib/components/Chip/types.d.ts +50 -0
- package/lib/components/Chip/types.d.ts.map +1 -0
- package/lib/components/Chip/types.js +1 -0
- package/lib/components/Divider/StyledDivider.d.ts +12 -0
- package/lib/components/Divider/StyledDivider.d.ts.map +1 -0
- package/lib/components/Divider/StyledDivider.js +17 -0
- package/lib/components/Divider/index.d.ts +15 -0
- package/lib/components/Divider/index.d.ts.map +1 -0
- package/lib/components/Divider/index.js +4 -0
- package/lib/components/FastList/index.d.ts +25 -0
- package/lib/components/FastList/index.d.ts.map +1 -0
- package/lib/components/FastList/index.js +13 -0
- package/lib/components/Filter/index.d.ts +40 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +23 -0
- package/lib/components/Gradient/index.d.ts +11 -0
- package/lib/components/Gradient/index.d.ts.map +1 -0
- package/lib/components/Gradient/index.js +10 -0
- package/lib/components/Header/BackButton.d.ts +5 -0
- package/lib/components/Header/BackButton.d.ts.map +1 -0
- package/lib/components/Header/BackButton.js +22 -0
- package/lib/components/Header/DefaultHeader.d.ts +8 -0
- package/lib/components/Header/DefaultHeader.d.ts.map +1 -0
- package/lib/components/Header/DefaultHeader.js +13 -0
- package/lib/components/Header/HeaderContent.d.ts +6 -0
- package/lib/components/Header/HeaderContent.d.ts.map +1 -0
- package/lib/components/Header/HeaderContent.js +18 -0
- package/lib/components/Header/IconButton.d.ts +13 -0
- package/lib/components/Header/IconButton.d.ts.map +1 -0
- package/lib/components/Header/IconButton.js +6 -0
- package/lib/components/Header/ProgressHeader.d.ts +7 -0
- package/lib/components/Header/ProgressHeader.d.ts.map +1 -0
- package/lib/components/Header/ProgressHeader.js +18 -0
- package/lib/components/Header/RightButton.d.ts +3 -0
- package/lib/components/Header/RightButton.d.ts.map +1 -0
- package/lib/components/Header/RightButton.js +15 -0
- package/lib/components/Header/index.d.ts +4 -0
- package/lib/components/Header/index.d.ts.map +1 -0
- package/lib/components/Header/index.js +12 -0
- package/lib/components/Header/types.d.ts +86 -0
- package/lib/components/Header/types.d.ts.map +1 -0
- package/lib/components/Header/types.js +1 -0
- package/lib/components/Header/utils.d.ts +10 -0
- package/lib/components/Header/utils.d.ts.map +1 -0
- package/lib/components/Header/utils.js +3 -0
- package/lib/components/Icon/AnimatedIcon.d.ts +6 -0
- package/lib/components/Icon/AnimatedIcon.d.ts.map +1 -0
- package/lib/components/Icon/AnimatedIcon.js +34 -0
- package/lib/components/Icon/PlainIcon.d.ts +16 -0
- package/lib/components/Icon/PlainIcon.d.ts.map +1 -0
- package/lib/components/Icon/PlainIcon.js +13 -0
- package/lib/components/Icon/constants.d.ts +703 -0
- package/lib/components/Icon/constants.d.ts.map +1 -0
- package/lib/components/Icon/constants.js +702 -0
- package/lib/components/Icon/index.d.ts +34 -0
- package/lib/components/Icon/index.d.ts.map +1 -0
- package/lib/components/Icon/index.js +24 -0
- package/lib/components/Icon/utils.d.ts +3 -0
- package/lib/components/Icon/utils.d.ts.map +1 -0
- package/lib/components/Icon/utils.js +2 -0
- package/lib/components/Image/ImageDetail.d.ts +11 -0
- package/lib/components/Image/ImageDetail.d.ts.map +1 -0
- package/lib/components/Image/ImageDetail.js +33 -0
- package/lib/components/Image/index.d.ts +11 -0
- package/lib/components/Image/index.d.ts.map +1 -0
- package/lib/components/Image/index.js +5 -0
- package/lib/components/Image/utils.d.ts +6 -0
- package/lib/components/Image/utils.d.ts.map +1 -0
- package/lib/components/Image/utils.js +12 -0
- package/lib/components/InfoCard/BasicInfoCard.d.ts +19 -0
- package/lib/components/InfoCard/BasicInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/BasicInfoCard.js +18 -0
- package/lib/components/InfoCard/NewsInfoCard.d.ts +22 -0
- package/lib/components/InfoCard/NewsInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/NewsInfoCard.js +15 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.d.ts +33 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.d.ts.map +1 -0
- package/lib/components/InfoCard/ThumbnailInfoCard.js +24 -0
- package/lib/components/InfoCard/index.d.ts +15 -0
- package/lib/components/InfoCard/index.d.ts.map +1 -0
- package/lib/components/InfoCard/index.js +16 -0
- package/lib/components/Input/StyledInput.d.ts +13 -0
- package/lib/components/Input/StyledInput.d.ts.map +1 -0
- package/lib/components/Input/StyledInput.js +14 -0
- package/lib/components/Input/index.d.ts +34 -0
- package/lib/components/Input/index.d.ts.map +1 -0
- package/lib/components/Input/index.js +15 -0
- package/lib/components/LevelStep/CircularProgress.d.ts +12 -0
- package/lib/components/LevelStep/CircularProgress.d.ts.map +1 -0
- package/lib/components/LevelStep/CircularProgress.js +27 -0
- package/lib/components/LevelStep/TransformedSvg.d.ts +13 -0
- package/lib/components/LevelStep/TransformedSvg.d.ts.map +1 -0
- package/lib/components/LevelStep/TransformedSvg.js +9 -0
- package/lib/components/LevelStep/constants.d.ts +8 -0
- package/lib/components/LevelStep/constants.d.ts.map +1 -0
- package/lib/components/LevelStep/constants.js +17 -0
- package/lib/components/LevelStep/index.d.ts +3 -0
- package/lib/components/LevelStep/index.d.ts.map +1 -0
- package/lib/components/LevelStep/index.js +78 -0
- package/lib/components/LevelStep/types.d.ts +7 -0
- package/lib/components/LevelStep/types.d.ts.map +1 -0
- package/lib/components/LevelStep/types.js +1 -0
- package/lib/components/List/index.d.ts +13 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +13 -0
- package/lib/components/Loading/Loading.d.ts +3 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +61 -0
- package/lib/components/Loading/StyledLoading.d.ts +14 -0
- package/lib/components/Loading/StyledLoading.d.ts.map +1 -0
- package/lib/components/Loading/StyledLoading.js +18 -0
- package/lib/components/Loading/index.d.ts +3 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +26 -0
- package/lib/components/Loading/types.d.ts +25 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Loading/types.js +1 -0
- package/lib/components/Notification/Notification.d.ts +6 -0
- package/lib/components/Notification/Notification.d.ts.map +1 -0
- package/lib/components/Notification/Notification.js +13 -0
- package/lib/components/Notification/NotificationProvider.d.ts +4 -0
- package/lib/components/Notification/NotificationProvider.d.ts.map +1 -0
- package/lib/components/Notification/NotificationProvider.js +13 -0
- package/lib/components/Notification/Toast.d.ts +8 -0
- package/lib/components/Notification/Toast.d.ts.map +1 -0
- package/lib/components/Notification/Toast.js +32 -0
- package/lib/components/Notification/context.d.ts +7 -0
- package/lib/components/Notification/context.d.ts.map +1 -0
- package/lib/components/Notification/context.js +9 -0
- package/lib/components/Notification/index.d.ts +3 -0
- package/lib/components/Notification/index.d.ts.map +1 -0
- package/lib/components/Notification/index.js +2 -0
- package/lib/components/PlaySwitch/index.d.ts +4 -0
- package/lib/components/PlaySwitch/index.d.ts.map +1 -0
- package/lib/components/PlaySwitch/index.js +62 -0
- package/lib/components/PlaySwitch/types.d.ts +23 -0
- package/lib/components/PlaySwitch/types.d.ts.map +1 -0
- package/lib/components/PlaySwitch/types.js +1 -0
- package/lib/components/Progress/StyledProgress.d.ts +225 -0
- package/lib/components/Progress/StyledProgress.d.ts.map +1 -0
- package/lib/components/Progress/StyledProgress.js +22 -0
- package/lib/components/Progress/index.d.ts +25 -0
- package/lib/components/Progress/index.d.ts.map +1 -0
- package/lib/components/Progress/index.js +33 -0
- package/lib/components/Scrollable/StyledScrollable.d.ts +33 -0
- package/lib/components/Scrollable/StyledScrollable.d.ts.map +1 -0
- package/lib/components/Scrollable/StyledScrollable.js +56 -0
- package/lib/components/Scrollable/index.d.ts +6 -0
- package/lib/components/Scrollable/index.d.ts.map +1 -0
- package/lib/components/Scrollable/index.js +15 -0
- package/lib/components/Scrollable/types.d.ts +5 -0
- package/lib/components/Scrollable/types.d.ts.map +1 -0
- package/lib/components/Scrollable/types.js +1 -0
- package/lib/components/Sectional/Item.d.ts +13 -0
- package/lib/components/Sectional/Item.d.ts.map +1 -0
- package/lib/components/Sectional/Item.js +21 -0
- package/lib/components/Sectional/index.d.ts +9 -0
- package/lib/components/Sectional/index.d.ts.map +1 -0
- package/lib/components/Sectional/index.js +25 -0
- package/lib/components/Sectional/types.d.ts +33 -0
- package/lib/components/Sectional/types.d.ts.map +1 -0
- package/lib/components/Sectional/types.js +1 -0
- package/lib/components/Sectional/utils.d.ts +11 -0
- package/lib/components/Sectional/utils.d.ts.map +1 -0
- package/lib/components/Sectional/utils.js +37 -0
- package/lib/components/Selection/index.d.ts +17 -0
- package/lib/components/Selection/index.d.ts.map +1 -0
- package/lib/components/Selection/index.js +24 -0
- package/lib/components/Skeleton/SkeletonBackground.d.ts +6 -0
- package/lib/components/Skeleton/SkeletonBackground.d.ts.map +1 -0
- package/lib/components/Skeleton/SkeletonBackground.js +23 -0
- package/lib/components/Skeleton/SkeletonWrapper.d.ts +8 -0
- package/lib/components/Skeleton/SkeletonWrapper.d.ts.map +1 -0
- package/lib/components/Skeleton/SkeletonWrapper.js +50 -0
- package/lib/components/Skeleton/index.d.ts +4 -0
- package/lib/components/Skeleton/index.d.ts.map +1 -0
- package/lib/components/Skeleton/index.js +16 -0
- package/lib/components/Skeleton/types.d.ts +16 -0
- package/lib/components/Skeleton/types.d.ts.map +1 -0
- package/lib/components/Skeleton/types.js +1 -0
- package/lib/components/Slides/index.d.ts +14 -0
- package/lib/components/Slides/index.d.ts.map +1 -0
- package/lib/components/Slides/index.js +46 -0
- package/lib/components/Squircle/index.d.ts +35 -0
- package/lib/components/Squircle/index.d.ts.map +1 -0
- package/lib/components/Squircle/index.js +21 -0
- package/lib/components/Squircle/types.d.ts +20 -0
- package/lib/components/Squircle/types.d.ts.map +1 -0
- package/lib/components/Squircle/types.js +1 -0
- package/lib/components/Squircle/utils.d.ts +4 -0
- package/lib/components/Squircle/utils.d.ts.map +1 -0
- package/lib/components/Squircle/utils.js +86 -0
- package/lib/components/Text/StyledText.d.ts +18 -0
- package/lib/components/Text/StyledText.d.ts.map +1 -0
- package/lib/components/Text/StyledText.js +19 -0
- package/lib/components/Text/constants.d.ts +3 -0
- package/lib/components/Text/constants.d.ts.map +1 -0
- package/lib/components/Text/constants.js +6 -0
- package/lib/components/Text/index.d.ts +6 -0
- package/lib/components/Text/index.d.ts.map +1 -0
- package/lib/components/Text/index.js +7 -0
- package/lib/components/Text/types.d.ts +55 -0
- package/lib/components/Text/types.d.ts.map +1 -0
- package/lib/components/Text/types.js +1 -0
- package/lib/components/Text/withRichText.d.ts +6 -0
- package/lib/components/Text/withRichText.d.ts.map +1 -0
- package/lib/components/Text/withRichText.js +38 -0
- package/lib/components/Touchable/index.d.ts +5 -0
- package/lib/components/Touchable/index.d.ts.map +1 -0
- package/lib/components/Touchable/index.js +56 -0
- package/lib/components/Touchable/types.d.ts +22 -0
- package/lib/components/Touchable/types.d.ts.map +1 -0
- package/lib/components/Touchable/types.js +1 -0
- package/lib/components/Video/StyledVideoControlManager.d.ts +49 -0
- package/lib/components/Video/StyledVideoControlManager.d.ts.map +1 -0
- package/lib/components/Video/StyledVideoControlManager.js +64 -0
- package/lib/components/Video/StyledVideoDetail.d.ts +16 -0
- package/lib/components/Video/StyledVideoDetail.d.ts.map +1 -0
- package/lib/components/Video/StyledVideoDetail.js +23 -0
- package/lib/components/Video/VideoControlManager.d.ts +10 -0
- package/lib/components/Video/VideoControlManager.d.ts.map +1 -0
- package/lib/components/Video/VideoControlManager.js +67 -0
- package/lib/components/Video/VideoDetail.d.ts +11 -0
- package/lib/components/Video/VideoDetail.d.ts.map +1 -0
- package/lib/components/Video/VideoDetail.js +102 -0
- package/lib/components/Video/index.d.ts +25 -0
- package/lib/components/Video/index.d.ts.map +1 -0
- package/lib/components/Video/index.js +49 -0
- package/lib/components/Vimeo/Player.d.ts +4 -0
- package/lib/components/Vimeo/Player.d.ts.map +1 -0
- package/lib/components/Vimeo/Player.js +30 -0
- package/lib/components/Vimeo/constants.d.ts +2 -0
- package/lib/components/Vimeo/constants.d.ts.map +1 -0
- package/lib/components/Vimeo/constants.js +23 -0
- package/lib/components/Vimeo/index.d.ts +10 -0
- package/lib/components/Vimeo/index.d.ts.map +1 -0
- package/lib/components/Vimeo/index.js +35 -0
- package/lib/components/Vimeo/types.d.ts +74 -0
- package/lib/components/Vimeo/types.d.ts.map +1 -0
- package/lib/components/Vimeo/types.js +1 -0
- package/lib/components/Vimeo/utils.d.ts +4 -0
- package/lib/components/Vimeo/utils.d.ts.map +1 -0
- package/lib/components/Vimeo/utils.js +126 -0
- package/lib/components/index.d.ts +33 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +32 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/useKeyboard.d.ts +10 -0
- package/lib/hooks/useKeyboard.d.ts.map +1 -0
- package/lib/hooks/useKeyboard.js +54 -0
- package/lib/hooks/usePrevious.d.ts +3 -0
- package/lib/hooks/usePrevious.d.ts.map +1 -0
- package/lib/hooks/usePrevious.js +9 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/services/base/BaseResponse.d.ts +12 -0
- package/lib/services/base/BaseResponse.d.ts.map +1 -0
- package/lib/services/base/BaseResponse.js +9 -0
- package/lib/services/base/BaseService.d.ts +8 -0
- package/lib/services/base/BaseService.d.ts.map +1 -0
- package/lib/services/base/BaseService.js +61 -0
- package/lib/services/base/index.d.ts +3 -0
- package/lib/services/base/index.d.ts.map +1 -0
- package/lib/services/base/index.js +2 -0
- package/lib/services/hooks/index.d.ts +2 -0
- package/lib/services/hooks/index.d.ts.map +1 -0
- package/lib/services/hooks/index.js +1 -0
- package/lib/services/hooks/useRequest.d.ts +14 -0
- package/lib/services/hooks/useRequest.d.ts.map +1 -0
- package/lib/services/hooks/useRequest.js +30 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +2 -0
- package/lib/theme/ThemeProvider.d.ts +13 -0
- package/lib/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/theme/ThemeProvider.js +5 -0
- package/lib/theme/ThemeSwitcher.d.ts +9 -0
- package/lib/theme/ThemeSwitcher.d.ts.map +1 -0
- package/lib/theme/ThemeSwitcher.js +19 -0
- package/lib/theme/common/borders.d.ts +9 -0
- package/lib/theme/common/borders.d.ts.map +1 -0
- package/lib/theme/common/borders.js +27 -0
- package/lib/theme/common/colors.d.ts +74 -0
- package/lib/theme/common/colors.d.ts.map +1 -0
- package/lib/theme/common/colors.js +73 -0
- package/lib/theme/common/gradient.d.ts +13 -0
- package/lib/theme/common/gradient.d.ts.map +1 -0
- package/lib/theme/common/gradient.js +12 -0
- package/lib/theme/common/index.d.ts +50 -0
- package/lib/theme/common/index.d.ts.map +1 -0
- package/lib/theme/common/index.js +37 -0
- package/lib/theme/common/scale.d.ts +12 -0
- package/lib/theme/common/scale.d.ts.map +1 -0
- package/lib/theme/common/scale.js +16 -0
- package/lib/theme/common/shadows.d.ts +17 -0
- package/lib/theme/common/shadows.d.ts.map +1 -0
- package/lib/theme/common/shadows.js +13 -0
- package/lib/theme/common/sizes.d.ts +6 -0
- package/lib/theme/common/sizes.d.ts.map +1 -0
- package/lib/theme/common/sizes.js +26 -0
- package/lib/theme/common/spaces.d.ts +5 -0
- package/lib/theme/common/spaces.d.ts.map +1 -0
- package/lib/theme/common/spaces.js +31 -0
- package/lib/theme/common/text.d.ts +14 -0
- package/lib/theme/common/text.d.ts.map +1 -0
- package/lib/theme/common/text.js +70 -0
- package/lib/theme/components/art.d.ts +17 -0
- package/lib/theme/components/art.d.ts.map +1 -0
- package/lib/theme/components/art.js +15 -0
- package/lib/theme/components/avatar.d.ts +11 -0
- package/lib/theme/components/avatar.d.ts.map +1 -0
- package/lib/theme/components/avatar.js +20 -0
- package/lib/theme/components/base.d.ts +14 -0
- package/lib/theme/components/base.d.ts.map +1 -0
- package/lib/theme/components/base.js +17 -0
- package/lib/theme/components/bubble.d.ts +6 -0
- package/lib/theme/components/bubble.d.ts.map +1 -0
- package/lib/theme/components/bubble.js +10 -0
- package/lib/theme/components/button.d.ts +12 -0
- package/lib/theme/components/button.d.ts.map +1 -0
- package/lib/theme/components/button.js +22 -0
- package/lib/theme/components/card.d.ts +8 -0
- package/lib/theme/components/card.d.ts.map +1 -0
- package/lib/theme/components/card.js +16 -0
- package/lib/theme/components/chart.d.ts +16 -0
- package/lib/theme/components/chart.d.ts.map +1 -0
- package/lib/theme/components/chart.js +22 -0
- package/lib/theme/components/chat.d.ts +11 -0
- package/lib/theme/components/chat.d.ts.map +1 -0
- package/lib/theme/components/chat.js +20 -0
- package/lib/theme/components/chip.d.ts +18 -0
- package/lib/theme/components/chip.d.ts.map +1 -0
- package/lib/theme/components/chip.js +43 -0
- package/lib/theme/components/divider.d.ts +12 -0
- package/lib/theme/components/divider.d.ts.map +1 -0
- package/lib/theme/components/divider.js +16 -0
- package/lib/theme/components/filter.d.ts +5 -0
- package/lib/theme/components/filter.d.ts.map +1 -0
- package/lib/theme/components/filter.js +8 -0
- package/lib/theme/components/header.d.ts +30 -0
- package/lib/theme/components/header.d.ts.map +1 -0
- package/lib/theme/components/header.js +36 -0
- package/lib/theme/components/image.d.ts +4 -0
- package/lib/theme/components/image.d.ts.map +1 -0
- package/lib/theme/components/image.js +6 -0
- package/lib/theme/components/index.d.ts +27 -0
- package/lib/theme/components/index.d.ts.map +1 -0
- package/lib/theme/components/index.js +26 -0
- package/lib/theme/components/infoCard.d.ts +25 -0
- package/lib/theme/components/infoCard.d.ts.map +1 -0
- package/lib/theme/components/infoCard.js +32 -0
- package/lib/theme/components/input.d.ts +21 -0
- package/lib/theme/components/input.d.ts.map +1 -0
- package/lib/theme/components/input.js +34 -0
- package/lib/theme/components/levelStep.d.ts +48 -0
- package/lib/theme/components/levelStep.d.ts.map +1 -0
- package/lib/theme/components/levelStep.js +56 -0
- package/lib/theme/components/loading.d.ts +16 -0
- package/lib/theme/components/loading.d.ts.map +1 -0
- package/lib/theme/components/loading.js +27 -0
- package/lib/theme/components/notification.d.ts +23 -0
- package/lib/theme/components/notification.d.ts.map +1 -0
- package/lib/theme/components/notification.js +38 -0
- package/lib/theme/components/playSwitch.d.ts +10 -0
- package/lib/theme/components/playSwitch.d.ts.map +1 -0
- package/lib/theme/components/playSwitch.js +14 -0
- package/lib/theme/components/progress.d.ts +10 -0
- package/lib/theme/components/progress.d.ts.map +1 -0
- package/lib/theme/components/progress.js +14 -0
- package/lib/theme/components/selection.d.ts +9 -0
- package/lib/theme/components/selection.d.ts.map +1 -0
- package/lib/theme/components/selection.js +21 -0
- package/lib/theme/components/skeleton.d.ts +11 -0
- package/lib/theme/components/skeleton.d.ts.map +1 -0
- package/lib/theme/components/skeleton.js +18 -0
- package/lib/theme/components/slides.d.ts +7 -0
- package/lib/theme/components/slides.d.ts.map +1 -0
- package/lib/theme/components/slides.js +10 -0
- package/lib/theme/components/text.d.ts +21 -0
- package/lib/theme/components/text.d.ts.map +1 -0
- package/lib/theme/components/text.js +22 -0
- package/lib/theme/components/touchable.d.ts +15 -0
- package/lib/theme/components/touchable.d.ts.map +1 -0
- package/lib/theme/components/touchable.js +41 -0
- package/lib/theme/components/video.d.ts +18 -0
- package/lib/theme/components/video.d.ts.map +1 -0
- package/lib/theme/components/video.js +47 -0
- package/lib/theme/getTheme.d.ts +34 -0
- package/lib/theme/getTheme.d.ts.map +1 -0
- package/lib/theme/getTheme.js +36 -0
- package/lib/theme/index.d.ts +10 -0
- package/lib/theme/index.d.ts.map +1 -0
- package/lib/theme/index.js +7 -0
- package/lib/utils/api/index.d.ts +3 -0
- package/lib/utils/api/index.d.ts.map +1 -0
- package/lib/utils/api/index.js +2 -0
- package/lib/utils/api/keys.d.ts +3 -0
- package/lib/utils/api/keys.d.ts.map +1 -0
- package/lib/utils/api/keys.js +11 -0
- package/lib/utils/api/urls.d.ts +3 -0
- package/lib/utils/api/urls.d.ts.map +1 -0
- package/lib/utils/api/urls.js +8 -0
- package/lib/utils/format/index.d.ts +3 -0
- package/lib/utils/format/index.d.ts.map +1 -0
- package/lib/utils/format/index.js +2 -0
- package/lib/utils/format/text.d.ts +4 -0
- package/lib/utils/format/text.d.ts.map +1 -0
- package/lib/utils/format/text.js +13 -0
- package/lib/utils/haptic/index.d.ts +4 -0
- package/lib/utils/haptic/index.d.ts.map +1 -0
- package/lib/utils/haptic/index.js +3 -0
- package/lib/utils/haptic/types.d.ts +25 -0
- package/lib/utils/haptic/types.d.ts.map +1 -0
- package/lib/utils/haptic/types.js +25 -0
- package/lib/utils/haptic/utils.d.ts +3 -0
- package/lib/utils/haptic/utils.d.ts.map +1 -0
- package/lib/utils/haptic/utils.js +8 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/intl/IntlProvider.d.ts +7 -0
- package/lib/utils/intl/IntlProvider.d.ts.map +1 -0
- package/lib/utils/intl/IntlProvider.js +16 -0
- package/lib/utils/intl/context.d.ts +15 -0
- package/lib/utils/intl/context.d.ts.map +1 -0
- package/lib/utils/intl/context.js +9 -0
- package/lib/utils/intl/global.d.ts +7 -0
- package/lib/utils/intl/global.d.ts.map +1 -0
- package/lib/utils/intl/global.js +1 -0
- package/lib/utils/intl/hooks.d.ts +7 -0
- package/lib/utils/intl/hooks.d.ts.map +1 -0
- package/lib/utils/intl/hooks.js +10 -0
- package/lib/utils/intl/index.d.ts +5 -0
- package/lib/utils/intl/index.d.ts.map +1 -0
- package/lib/utils/intl/index.js +4 -0
- package/lib/utils/intl/state.d.ts +12 -0
- package/lib/utils/intl/state.d.ts.map +1 -0
- package/lib/utils/intl/state.js +14 -0
- package/lib/utils/intl/utils.d.ts +6 -0
- package/lib/utils/intl/utils.d.ts.map +1 -0
- package/lib/utils/intl/utils.js +7 -0
- package/lib/utils/notification/index.d.ts +2 -0
- package/lib/utils/notification/index.d.ts.map +1 -0
- package/lib/utils/notification/index.js +1 -0
- package/lib/utils/notification/toast/constants.d.ts +4 -0
- package/lib/utils/notification/toast/constants.d.ts.map +1 -0
- package/lib/utils/notification/toast/constants.js +7 -0
- package/lib/utils/notification/toast/index.d.ts +3 -0
- package/lib/utils/notification/toast/index.d.ts.map +1 -0
- package/lib/utils/notification/toast/index.js +2 -0
- package/lib/utils/notification/toast/types.d.ts +2 -0
- package/lib/utils/notification/toast/types.d.ts.map +1 -0
- package/lib/utils/notification/toast/types.js +1 -0
- package/lib/utils/notification/toast/utils.d.ts +6 -0
- package/lib/utils/notification/toast/utils.d.ts.map +1 -0
- package/lib/utils/notification/toast/utils.js +23 -0
- package/lib/utils/routes/index.d.ts +4 -0
- package/lib/utils/routes/index.d.ts.map +1 -0
- package/lib/utils/routes/index.js +3 -0
- package/lib/utils/routes/types.d.ts +10 -0
- package/lib/utils/routes/types.d.ts.map +1 -0
- package/lib/utils/routes/types.js +1 -0
- package/lib/utils/routes/utils.d.ts +5 -0
- package/lib/utils/routes/utils.d.ts.map +1 -0
- package/lib/utils/routes/utils.js +3 -0
- package/lib/utils/scale.d.ts +4 -0
- package/lib/utils/scale.d.ts.map +1 -0
- package/lib/utils/scale.js +15 -0
- package/lib/utils/ui/color/index.d.ts +3 -0
- package/lib/utils/ui/color/index.d.ts.map +1 -0
- package/lib/utils/ui/color/index.js +2 -0
- package/lib/utils/ui/color/utils.d.ts +2 -0
- package/lib/utils/ui/color/utils.d.ts.map +1 -0
- package/lib/utils/ui/color/utils.js +9 -0
- package/lib/utils/ui/index.d.ts +2 -0
- package/lib/utils/ui/index.d.ts.map +1 -0
- package/lib/utils/ui/index.js +1 -0
- package/package.json +7 -6
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Canvas } from '@shopify/react-native-skia';
|
|
3
|
+
import { isNil } from 'lodash';
|
|
4
|
+
import { useCallback, useMemo } from 'react';
|
|
5
|
+
import { Pressable } from 'react-native';
|
|
6
|
+
import { runOnJS, useDerivedValue, useSharedValue, withDelay, withSpring, withTiming, } from 'react-native-reanimated';
|
|
7
|
+
import { useTheme } from '../../theme';
|
|
8
|
+
import { HapticFeedback, HapticFeedbackTypes } from '../../utils';
|
|
9
|
+
import { CircularProgress } from './CircularProgress';
|
|
10
|
+
import { LEVEL_STEP_ASSETS } from './constants';
|
|
11
|
+
import { TransformedSvg } from './TransformedSvg';
|
|
12
|
+
export const LevelStep = (props) => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const themeLevelStep = useMemo(() => theme.__hd__.levelStep, [theme]);
|
|
15
|
+
const themeTop = useMemo(() => themeLevelStep.top, [themeLevelStep]);
|
|
16
|
+
const themeBottom = useMemo(() => themeLevelStep.bottom, [themeLevelStep]);
|
|
17
|
+
const themeProgress = useMemo(() => themeLevelStep.progress, [themeLevelStep]);
|
|
18
|
+
const themeAnimation = useMemo(() => themeLevelStep.animation, [themeLevelStep]);
|
|
19
|
+
const { onPress, type = themeLevelStep.defaultType, progress } = props;
|
|
20
|
+
const assetInfo = useMemo(() => LEVEL_STEP_ASSETS[type], [type]);
|
|
21
|
+
const transformY = useSharedValue(0);
|
|
22
|
+
const progressSharedValue = useSharedValue(progress);
|
|
23
|
+
const topBox = useDerivedValue(() => ({
|
|
24
|
+
x: themeTop.x,
|
|
25
|
+
y: themeTop.y + transformY.value,
|
|
26
|
+
width: themeTop.width,
|
|
27
|
+
height: themeTop.height,
|
|
28
|
+
}));
|
|
29
|
+
const bottomBox = useDerivedValue(() => ({
|
|
30
|
+
x: themeBottom.x,
|
|
31
|
+
y: themeBottom.y + transformY.value,
|
|
32
|
+
width: themeBottom.width,
|
|
33
|
+
height: themeBottom.height - transformY.value,
|
|
34
|
+
}));
|
|
35
|
+
const handlePressIn = useCallback(() => {
|
|
36
|
+
transformY.value = withSpring(themeAnimation.button.transformY.max, {
|
|
37
|
+
mass: themeAnimation.button.springConfig.mass,
|
|
38
|
+
});
|
|
39
|
+
HapticFeedback.trigger(HapticFeedbackTypes.soft);
|
|
40
|
+
}, [
|
|
41
|
+
themeAnimation.button.springConfig.mass,
|
|
42
|
+
themeAnimation.button.transformY.max,
|
|
43
|
+
transformY,
|
|
44
|
+
]);
|
|
45
|
+
const handlePressOut = useCallback(() => {
|
|
46
|
+
transformY.value = withSpring(themeAnimation.button.transformY.min, {
|
|
47
|
+
mass: themeAnimation.button.springConfig.mass,
|
|
48
|
+
});
|
|
49
|
+
}, [
|
|
50
|
+
themeAnimation.button.springConfig.mass,
|
|
51
|
+
themeAnimation.button.transformY.min,
|
|
52
|
+
transformY,
|
|
53
|
+
]);
|
|
54
|
+
const handleNullableOnPress = useCallback((event) => {
|
|
55
|
+
if (!isNil(onPress)) {
|
|
56
|
+
onPress(event);
|
|
57
|
+
}
|
|
58
|
+
}, [onPress]);
|
|
59
|
+
const handlePress = useCallback((event) => {
|
|
60
|
+
if (type !== 'locked') {
|
|
61
|
+
progressSharedValue.value = withDelay(themeAnimation.progress.delay, withSpring(1, {
|
|
62
|
+
mass: themeAnimation.progress.springConfig.mass,
|
|
63
|
+
}, () => {
|
|
64
|
+
runOnJS(handleNullableOnPress)(event);
|
|
65
|
+
progressSharedValue.value = withDelay(themeAnimation.progress.postPressDelay, withTiming(progress));
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
}, [
|
|
69
|
+
handleNullableOnPress,
|
|
70
|
+
progress,
|
|
71
|
+
progressSharedValue,
|
|
72
|
+
themeAnimation.progress.delay,
|
|
73
|
+
themeAnimation.progress.postPressDelay,
|
|
74
|
+
themeAnimation.progress.springConfig.mass,
|
|
75
|
+
type,
|
|
76
|
+
]);
|
|
77
|
+
return (_jsx(Pressable, { onPress: handlePress, onPressIn: handlePressIn, onPressOut: handlePressOut, children: _jsxs(Canvas, { style: themeLevelStep.canvas, children: [_jsx(CircularProgress, { progress: progressSharedValue, width: themeLevelStep.circularProgress.width, height: themeLevelStep.circularProgress.height, backgroundColor: themeProgress.backgroundColor, foregroundColor: theme.colors[assetInfo.color], strokeWidth: themeProgress.strokeWidth, springMass: themeAnimation.button.springConfig.mass }), _jsx(TransformedSvg, { source: assetInfo.bottom, box: bottomBox }), _jsx(TransformedSvg, { source: assetInfo.top, box: topBox })] }) }));
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/LevelStep/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IAMrE,IAAI,CAAC,EAAE,aAAa,CAAC;IAKrB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ForwardedRef } from 'react';
|
|
2
|
+
import { FlatList, type FlatListProps, type ListRenderItem } from 'react-native';
|
|
3
|
+
import { type ScrollableProps } from '../Scrollable';
|
|
4
|
+
export interface ListProps<T> extends Omit<ScrollableProps, 'children' | 'renderItem'>, Omit<FlatListProps<T>, 'children' | 'renderItem'> {
|
|
5
|
+
children?: ListRenderItem<T> | null | undefined;
|
|
6
|
+
renderItem?: ListRenderItem<T> | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
declare function PlainList<T>({ style, contentContainerStyle, renderItem, children, ...otherProps }: ListProps<T>, ref: ForwardedRef<FlatList<T>>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const List: <T>(props: ListProps<T> & {
|
|
10
|
+
ref?: ForwardedRef<FlatList<T>>;
|
|
11
|
+
}) => ReturnType<typeof PlainList>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/List/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGjF,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,SAAS,CAAC,CAAC,CAC1B,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,YAAY,CAAC,EACtD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IAKnD,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAKjD,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAClD;AAED,iBAAS,SAAS,CAAC,CAAC,EAClB,EACE,KAAK,EACL,qBAAqB,EACrB,UAAU,EACV,QAAQ,EACR,GAAG,UAAU,EACd,EAAE,SAAS,CAAC,CAAC,CAAC,EACf,GAAG,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,2CAiB/B;AAED,eAAO,MAAM,IAAI,EAA4B,CAAC,CAAC,EAC7C,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,KACtD,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { FlatList } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../theme';
|
|
5
|
+
import { genScrollableContainerStyle, genScrollableContentContainerStyle, } from '../Scrollable';
|
|
6
|
+
function PlainList({ style, contentContainerStyle, renderItem, children, ...otherProps }, ref) {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
return (_jsx(FlatList, { ref: ref, renderItem: renderItem || children, style: [genScrollableContainerStyle(theme, otherProps), style], showsHorizontalScrollIndicator: false, showsVerticalScrollIndicator: false, contentContainerStyle: [
|
|
9
|
+
genScrollableContentContainerStyle(theme, otherProps),
|
|
10
|
+
contentContainerStyle,
|
|
11
|
+
], ...otherProps }));
|
|
12
|
+
}
|
|
13
|
+
export const List = forwardRef(PlainList);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../../src/components/Loading/Loading.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,gBAAgB,8BAI1B,YAAY,4CAkGd,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Path, Skia } from '@shopify/react-native-skia';
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import Animated, { Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withRepeat, withTiming, } from 'react-native-reanimated';
|
|
5
|
+
import { useTheme } from '../../theme';
|
|
6
|
+
import { StyledCanvas } from './StyledLoading';
|
|
7
|
+
export const LoadingComponent = ({ size, color = 'primary', loading = true, }) => {
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const themeLoading = useMemo(() => theme.__hd__.loading, [theme.__hd__.loading]);
|
|
10
|
+
const strokeWidth = useMemo(() => themeLoading.strokeWidths[size], [size, themeLoading.strokeWidths]);
|
|
11
|
+
const diameter = useMemo(() => themeLoading.sizes[size], [size, themeLoading.sizes]);
|
|
12
|
+
const maxRadius = useMemo(() => diameter / 2 - strokeWidth, [diameter, strokeWidth]);
|
|
13
|
+
const scale = useSharedValue(loading ? 1 : 0);
|
|
14
|
+
const opacity = useSharedValue(loading ? 1 : 0);
|
|
15
|
+
const startAngle = useSharedValue(0);
|
|
16
|
+
const sweepAngle = useSharedValue(themeLoading.arc.minAngle);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
startAngle.value = withRepeat(withTiming(360, {
|
|
19
|
+
duration: themeLoading.animation.loopInterval,
|
|
20
|
+
easing: Easing.linear,
|
|
21
|
+
}), -1);
|
|
22
|
+
sweepAngle.value = withRepeat(withTiming(themeLoading.arc.maxAngle, {
|
|
23
|
+
duration: themeLoading.animation.loopInterval * 2,
|
|
24
|
+
}), -1, true);
|
|
25
|
+
}, [
|
|
26
|
+
sweepAngle,
|
|
27
|
+
startAngle,
|
|
28
|
+
themeLoading.animation.loopInterval,
|
|
29
|
+
themeLoading.arc.maxAngle,
|
|
30
|
+
]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
scale.value = withTiming(loading ? 1 : 0, {
|
|
33
|
+
duration: themeLoading.animation.showingDuration,
|
|
34
|
+
});
|
|
35
|
+
opacity.value = withTiming(loading ? 1 : 0, {
|
|
36
|
+
duration: themeLoading.animation.showingDuration,
|
|
37
|
+
easing: loading ? Easing.out(Easing.poly(8)) : Easing.poly(8),
|
|
38
|
+
});
|
|
39
|
+
}, [
|
|
40
|
+
maxRadius,
|
|
41
|
+
opacity,
|
|
42
|
+
scale,
|
|
43
|
+
diameter,
|
|
44
|
+
themeLoading.animation.showingDuration,
|
|
45
|
+
loading,
|
|
46
|
+
]);
|
|
47
|
+
const pathValue = useDerivedValue(() => {
|
|
48
|
+
const path = Skia.Path.Make();
|
|
49
|
+
const cx = diameter / 2;
|
|
50
|
+
const cy = diameter / 2;
|
|
51
|
+
path.addArc({
|
|
52
|
+
x: cx - maxRadius,
|
|
53
|
+
y: cy - maxRadius,
|
|
54
|
+
width: maxRadius * 2,
|
|
55
|
+
height: maxRadius * 2,
|
|
56
|
+
}, startAngle.value, sweepAngle.value * scale.value);
|
|
57
|
+
return path;
|
|
58
|
+
});
|
|
59
|
+
const animatedStyle = useAnimatedStyle(() => ({ opacity: opacity.value }));
|
|
60
|
+
return (_jsx(Animated.View, { style: animatedStyle, children: _jsx(StyledCanvas, { size: diameter, children: _jsx(Path, { path: pathValue, antiAlias: true, style: "stroke", color: theme.colors[color], strokeWidth: strokeWidth, strokeCap: "round" }) }) }));
|
|
61
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const StyledCanvas: import("@emotion/native").StyledComponent<import("@shopify/react-native-skia").CanvasProps & import("react").RefAttributes<import("@shopify/react-native-skia").SkiaDomView> & {
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
} & {
|
|
5
|
+
size: number;
|
|
6
|
+
opacity?: number;
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export declare const StyledLoadingContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
}, {}, {
|
|
12
|
+
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=StyledLoading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledLoading.d.ts","sourceRoot":"","sources":["../../../src/components/Loading/StyledLoading.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;SAoBi5K,MAAO,WAAW;;UAnBp7K,MAAM;cACF,MAAM;UAOhB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;SASoyB,MAAO,WAAW;;;EADx1B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { Canvas } from '@shopify/react-native-skia';
|
|
3
|
+
export const StyledCanvas = styled(Canvas)(({ size, opacity }) => {
|
|
4
|
+
return {
|
|
5
|
+
width: size,
|
|
6
|
+
height: size,
|
|
7
|
+
opacity,
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
export const StyledLoadingContainer = styled.View `
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Loading/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO,4DAOjB,YAAY,4CA0Cd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
4
|
+
import { useTheme } from '../../theme';
|
|
5
|
+
import { Box } from '../Box';
|
|
6
|
+
import { LoadingComponent } from './Loading';
|
|
7
|
+
import { StyledLoadingContainer } from './StyledLoading';
|
|
8
|
+
export const Loading = ({ size, loading = true, color = 'primary', children, testID, ...boxProps }) => {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const opacity = useSharedValue(loading ? 0 : 1);
|
|
11
|
+
const animatedStyle = useAnimatedStyle(() => ({ opacity: opacity.value }));
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
opacity.value = withTiming(loading ? 0 : 1, {
|
|
14
|
+
duration: theme.__hd__.loading.animation.contentShowingDuration,
|
|
15
|
+
easing: loading ? Easing.out(Easing.poly(8)) : Easing.poly(8),
|
|
16
|
+
});
|
|
17
|
+
}, [
|
|
18
|
+
loading,
|
|
19
|
+
opacity,
|
|
20
|
+
theme.__hd__.loading.animation.contentShowingDuration,
|
|
21
|
+
]);
|
|
22
|
+
if (!children) {
|
|
23
|
+
return (_jsx(LoadingComponent, { size: size, color: color, loading: loading, testID: testID }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs(Box, { ...boxProps, children: [_jsx(StyledLoadingContainer, { children: _jsx(LoadingComponent, { size: size, color: color, loading: loading, testID: testID }) }), _jsx(Animated.View, { style: animatedStyle, children: children })] }));
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Color, LoadingSize } from '../../theme';
|
|
2
|
+
import type { BoxProps } from '../Box';
|
|
3
|
+
export interface LoadingProps extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* Size of the view.
|
|
6
|
+
*/
|
|
7
|
+
size: LoadingSize;
|
|
8
|
+
/**
|
|
9
|
+
* Loading state of the loading indicator.
|
|
10
|
+
*/
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Color of the loading indicator.
|
|
14
|
+
*/
|
|
15
|
+
color?: Color;
|
|
16
|
+
/**
|
|
17
|
+
* Children of the loading indicator.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Test ID of the loading indicator.
|
|
22
|
+
*/
|
|
23
|
+
testID?: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Loading/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C;;OAEG;IACJ,IAAI,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACJ,KAAK,CAAC,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface NotificationComponentProps {
|
|
2
|
+
topInset: number;
|
|
3
|
+
}
|
|
4
|
+
declare const NotificationComponent: ({ topInset }: NotificationComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { NotificationComponent as Notification };
|
|
6
|
+
//# sourceMappingURL=Notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.tsx"],"names":[],"mappings":"AAeA,UAAU,0BAA0B;IACnC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,qBAAqB,iBAAkB,0BAA0B,4CAEtE,CAAC;AAEF,OAAO,EAAE,qBAAqB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Toast, {} from 'react-native-toast-message';
|
|
3
|
+
import { Toast as ToastComponent } from './Toast';
|
|
4
|
+
const notificationConfig = {
|
|
5
|
+
toastSuccess: ({ text1 }) => _jsx(ToastComponent, { type: "success", message: text1 || '' }),
|
|
6
|
+
toastError: ({ text1 }) => _jsx(ToastComponent, { type: "error", message: text1 || '' }),
|
|
7
|
+
toastInfo: ({ text1 }) => _jsx(ToastComponent, { type: "info", message: text1 || '' }),
|
|
8
|
+
toastWarning: ({ text1 }) => _jsx(ToastComponent, { type: "warning", message: text1 || '' }),
|
|
9
|
+
};
|
|
10
|
+
const NotificationComponent = ({ topInset }) => {
|
|
11
|
+
return _jsx(Toast, { config: notificationConfig, topOffset: topInset });
|
|
12
|
+
};
|
|
13
|
+
export { NotificationComponent as Notification };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/NotificationProvider.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,kBAE9B;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4CAe/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { NotificationContext } from './context';
|
|
4
|
+
import { Notification } from './Notification';
|
|
5
|
+
export const NotificationProvider = ({ children, }) => {
|
|
6
|
+
const [topInset, setTopInset] = useState(0);
|
|
7
|
+
const updateTopInset = useCallback((inset) => {
|
|
8
|
+
if (inset !== topInset) {
|
|
9
|
+
setTopInset(inset);
|
|
10
|
+
}
|
|
11
|
+
}, [topInset]);
|
|
12
|
+
return (_jsxs(NotificationContext.Provider, { value: { updateTopInset }, children: [children, _jsx(Notification, { topInset: topInset })] }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToastType } from '../../theme';
|
|
2
|
+
interface ToastProps {
|
|
3
|
+
type: ToastType;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Toast: ({ type, message }: ToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,aAAa,CAAC;AAOpD,UAAU,UAAU;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAgBD,eAAO,MAAM,KAAK,sBAAuB,UAAU,4CAkDlD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useWindowDimensions } from 'react-native';
|
|
5
|
+
import { useTheme } from '../../theme';
|
|
6
|
+
import { ColorUtils } from '../../utils';
|
|
7
|
+
import { Box } from '../Box';
|
|
8
|
+
import { Card } from '../Card';
|
|
9
|
+
import { Icon } from '../Icon';
|
|
10
|
+
import { Text } from '../Text';
|
|
11
|
+
const StyledBackground = styled.View `
|
|
12
|
+
background-color: ${({ theme, color, opacity }) => ColorUtils.convertHexToRGBA(theme.colors[color], opacity)};
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
`;
|
|
19
|
+
const StyledText = styled(Text) `
|
|
20
|
+
max-width: ${({ maxWidth }) => maxWidth}px;
|
|
21
|
+
`;
|
|
22
|
+
export const Toast = ({ type, message }) => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const themeToast = useMemo(() => theme.__hd__.notification.toast, [theme]);
|
|
25
|
+
const toastConfig = useMemo(() => themeToast.configs[type], [type, themeToast]);
|
|
26
|
+
const { width: screenWidth } = useWindowDimensions();
|
|
27
|
+
const textMaxWidth = screenWidth * themeToast.maxWidthScale
|
|
28
|
+
- 2 * theme.spaces[themeToast.paddingHorizontal]
|
|
29
|
+
- theme.spaces[themeToast.gap]
|
|
30
|
+
- theme.spaces[themeToast.iconSize];
|
|
31
|
+
return (_jsx(Card, { marginTop: themeToast.marginTop, borderRadius: themeToast.borderRadius, overflow: "hidden", children: _jsxs(Box, { flexDirection: "row", alignItems: "center", justifyContent: "flex-start", gap: themeToast.gap, paddingHorizontal: themeToast.paddingHorizontal, paddingVertical: themeToast.paddingVertical, children: [_jsx(StyledBackground, { color: toastConfig.color, opacity: themeToast.backgroundColorOpacity }), _jsx(Icon, { icon: toastConfig.icon, color: toastConfig.color, size: themeToast.iconSize }), _jsx(StyledText, { maxWidth: textMaxWidth, color: toastConfig.color, fontSize: themeToast.fontSize, fontWeight: themeToast.fontWeight, children: message })] }) }));
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type NotificationContextType = {
|
|
2
|
+
updateTopInset: (inset: number) => void;
|
|
3
|
+
};
|
|
4
|
+
export declare const NotificationContext: import("react").Context<NotificationContextType | null>;
|
|
5
|
+
export declare const useNotificationContext: () => NotificationContextType;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/context.ts"],"names":[],"mappings":"AAEA,KAAK,uBAAuB,GAAG;IAC7B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,yDACoB,CAAC;AAErD,eAAO,MAAM,sBAAsB,+BAMlC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const NotificationContext = createContext(null);
|
|
3
|
+
export const useNotificationContext = () => {
|
|
4
|
+
const context = useContext(NotificationContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('useNotificationContext must be used within a NotificationProvider');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PlaySwitch/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+FhD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isNumber } from 'lodash/fp';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { Art } from '../Art';
|
|
8
|
+
import { Touchable } from '../Touchable';
|
|
9
|
+
export const PlaySwitch = props => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const themePlaySwitch = useMemo(() => theme.__hd__.playSwitch, [theme.__hd__.playSwitch]);
|
|
12
|
+
const { size = themePlaySwitch.defaultSize, color = themePlaySwitch.defaultColor, status = themePlaySwitch.defaultStatus, onChange, ...boxProps } = props;
|
|
13
|
+
const [currentStatus, setCurrentStatus] = useState(status);
|
|
14
|
+
const playOpacity = useSharedValue(currentStatus === 'play' ? 1 : 0);
|
|
15
|
+
const playAngle = useSharedValue(currentStatus === 'play' ? 0 : 90);
|
|
16
|
+
const pauseOpacity = useSharedValue(currentStatus === 'pause' ? 1 : 1);
|
|
17
|
+
const pauseAngle = useSharedValue(currentStatus === 'pause' ? 0 : -90);
|
|
18
|
+
const handleStatusChange = useCallback(() => {
|
|
19
|
+
const newStatus = currentStatus === 'play' ? 'pause' : 'play';
|
|
20
|
+
setCurrentStatus(newStatus);
|
|
21
|
+
if (onChange) {
|
|
22
|
+
onChange(newStatus);
|
|
23
|
+
}
|
|
24
|
+
}, [currentStatus, onChange]);
|
|
25
|
+
const playArt = useMemo(() => require('../../assets/png/play.png'), []);
|
|
26
|
+
const pauseArt = useMemo(() => require('../../assets/png/pause.png'), []);
|
|
27
|
+
const sizeValue = useMemo(() => (isNumber(size) ? size : theme.sizes[size]), [size, theme.sizes]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
playOpacity.value = withTiming(currentStatus === 'play' ? 1 : 0, {
|
|
30
|
+
duration: themePlaySwitch.animation.showingDuration,
|
|
31
|
+
easing: Easing.out(Easing.poly(8)),
|
|
32
|
+
});
|
|
33
|
+
playAngle.value = withTiming(currentStatus === 'play' ? 0 : 90, {
|
|
34
|
+
duration: themePlaySwitch.animation.showingDuration,
|
|
35
|
+
easing: Easing.out(Easing.poly(8)),
|
|
36
|
+
});
|
|
37
|
+
pauseOpacity.value = withTiming(currentStatus === 'pause' ? 1 : 0, {
|
|
38
|
+
duration: themePlaySwitch.animation.showingDuration,
|
|
39
|
+
easing: Easing.out(Easing.poly(8)),
|
|
40
|
+
});
|
|
41
|
+
pauseAngle.value = withTiming(currentStatus === 'pause' ? 0 : -90, {
|
|
42
|
+
duration: themePlaySwitch.animation.showingDuration,
|
|
43
|
+
easing: Easing.out(Easing.poly(8)),
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
playOpacity,
|
|
47
|
+
themePlaySwitch.animation.showingDuration,
|
|
48
|
+
currentStatus,
|
|
49
|
+
pauseOpacity,
|
|
50
|
+
playAngle,
|
|
51
|
+
pauseAngle,
|
|
52
|
+
]);
|
|
53
|
+
const playAnimatedStyle = useAnimatedStyle(() => ({
|
|
54
|
+
opacity: playOpacity.value,
|
|
55
|
+
transform: [{ rotate: `${playAngle.value}deg` }],
|
|
56
|
+
}));
|
|
57
|
+
const pauseAnimatedStyle = useAnimatedStyle(() => ({
|
|
58
|
+
opacity: pauseOpacity.value,
|
|
59
|
+
transform: [{ rotate: `${pauseAngle.value}deg` }],
|
|
60
|
+
}));
|
|
61
|
+
return (_jsxs(Touchable, { width: sizeValue, height: sizeValue, alignItems: "center", justifyContent: "center", onPress: handleStatusChange, ...boxProps, children: [_jsx(Animated.View, { style: playAnimatedStyle, children: _jsx(Art, { art: playArt, type: "image", color: color, size: size }) }), _jsx(Animated.View, { style: [pauseAnimatedStyle, StyleSheet.absoluteFill], children: _jsx(Art, { art: pauseArt, type: "image", color: color, size: size }) })] }));
|
|
62
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Color, PlaySwitchStatus, Size } from '../../theme';
|
|
2
|
+
import type { BorderWidthsPropsKeyType, BoxProps, CustomBoxPropsKeyType, RadiiPropsKeyType, SpacePropsKeyType } from '../Box';
|
|
3
|
+
export interface PlaySwitchProps extends Pick<BoxProps, SpacePropsKeyType | RadiiPropsKeyType | BorderWidthsPropsKeyType | CustomBoxPropsKeyType> {
|
|
4
|
+
/**
|
|
5
|
+
* Size of the PlaySwitch, if width and height are the same.
|
|
6
|
+
*/
|
|
7
|
+
size?: Size | number | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Color of the PlaySwitch. Default is 'white'.
|
|
10
|
+
*
|
|
11
|
+
* @default 'white'
|
|
12
|
+
*/
|
|
13
|
+
color?: Color | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Status of the PlaySwitch.
|
|
16
|
+
*/
|
|
17
|
+
status?: PlaySwitchStatus;
|
|
18
|
+
/**
|
|
19
|
+
* Callback when the PlaySwitch status changes.
|
|
20
|
+
*/
|
|
21
|
+
onChange?: (status: PlaySwitchStatus) => void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/PlaySwitch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EACV,wBAAwB,EACxB,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,QAAQ,CAAC;AAEhB,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,QAAQ,EACN,iBAAiB,GACjB,iBAAiB,GACjB,wBAAwB,GACxB,qBAAqB,CACxB;IACD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAEjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|