related-ui-components 1.1.6
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/README.md +200 -0
- package/lib/commonjs/app/_layout.js +41 -0
- package/lib/commonjs/app/_layout.js.map +1 -0
- package/lib/commonjs/app/index.js +153 -0
- package/lib/commonjs/app/index.js.map +1 -0
- package/lib/commonjs/assets/components/BannerWithDetails.png +0 -0
- package/lib/commonjs/assets/components/DealCard-Horizontal.png +0 -0
- package/lib/commonjs/assets/components/DealCard-Vertical.png +0 -0
- package/lib/commonjs/assets/components/DealCard-floating.png +0 -0
- package/lib/commonjs/assets/components/DealCard-nested.png +0 -0
- package/lib/commonjs/assets/components/Filters.png +0 -0
- package/lib/commonjs/assets/components/Popup-1.png +0 -0
- package/lib/commonjs/assets/components/Popup-2.png +0 -0
- package/lib/commonjs/assets/components/Popup-3.png +0 -0
- package/lib/commonjs/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/lib/commonjs/assets/components/RedemptionOption-Vertical.png +0 -0
- package/lib/commonjs/assets/components/SimpleBanner.png +0 -0
- package/lib/commonjs/assets/components/SimpleTrendingCard.png +0 -0
- package/lib/commonjs/assets/components/SimpleTrendingCardV2.png +0 -0
- package/lib/commonjs/assets/components/UnlockRewards-1.png +0 -0
- package/lib/commonjs/assets/components/UnlockRewards-2.png +0 -0
- package/lib/commonjs/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/lib/commonjs/assets/images/adaptive-icon.png +0 -0
- package/lib/commonjs/assets/images/face.jpg +0 -0
- package/lib/commonjs/assets/images/favicon.png +0 -0
- package/lib/commonjs/assets/images/giftvoucher.jpg +0 -0
- package/lib/commonjs/assets/images/icon.png +0 -0
- package/lib/commonjs/assets/images/insta.webp +0 -0
- package/lib/commonjs/assets/images/muse.jpg +0 -0
- package/lib/commonjs/assets/images/namshi-banner.png +0 -0
- package/lib/commonjs/assets/images/namshi.webp +0 -0
- package/lib/commonjs/assets/images/partial-react-logo.png +0 -0
- package/lib/commonjs/assets/images/pb-logo.jpg +0 -0
- package/lib/commonjs/assets/images/pb.jpg +0 -0
- package/lib/commonjs/assets/images/react-logo.png +0 -0
- package/lib/commonjs/assets/images/react-logo@2x.png +0 -0
- package/lib/commonjs/assets/images/react-logo@3x.png +0 -0
- package/lib/commonjs/assets/images/scratch_foreground.png +0 -0
- package/lib/commonjs/assets/images/splash-icon.png +0 -0
- package/lib/commonjs/assets/images/upgrade.png +0 -0
- package/lib/commonjs/components/Badges/Badge.js +65 -0
- package/lib/commonjs/components/Badges/Badge.js.map +1 -0
- package/lib/commonjs/components/Badges/README.md +98 -0
- package/lib/commonjs/components/Badges/index.js +29 -0
- package/lib/commonjs/components/Badges/index.js.map +1 -0
- package/lib/commonjs/components/Banner/Banner.js +135 -0
- package/lib/commonjs/components/Banner/Banner.js.map +1 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.js +118 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.js.map +1 -0
- package/lib/commonjs/components/Banner/README.md +101 -0
- package/lib/commonjs/components/Banner/index.js +48 -0
- package/lib/commonjs/components/Banner/index.js.map +1 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.js +103 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.js.map +1 -0
- package/lib/commonjs/components/BrandIcon/index.js +29 -0
- package/lib/commonjs/components/BrandIcon/index.js.map +1 -0
- package/lib/commonjs/components/Card/Card.js +124 -0
- package/lib/commonjs/components/Card/Card.js.map +1 -0
- package/lib/commonjs/components/Card/CardContent.js +42 -0
- package/lib/commonjs/components/Card/CardContent.js.map +1 -0
- package/lib/commonjs/components/Card/CardFooter.js +34 -0
- package/lib/commonjs/components/Card/CardFooter.js.map +1 -0
- package/lib/commonjs/components/Card/CardHeader.js +77 -0
- package/lib/commonjs/components/Card/CardHeader.js.map +1 -0
- package/lib/commonjs/components/Card/CardImage.js +51 -0
- package/lib/commonjs/components/Card/CardImage.js.map +1 -0
- package/lib/commonjs/components/Card/index.js +98 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCard.js +188 -0
- package/lib/commonjs/components/Card/templates/DealCard.js.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.js +195 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.js.map +1 -0
- package/lib/commonjs/components/Card/templates/README.md +233 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.js +59 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.js.map +1 -0
- package/lib/commonjs/components/Card/types.js +6 -0
- package/lib/commonjs/components/Card/types.js.map +1 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.js +71 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.js.map +1 -0
- package/lib/commonjs/components/CloseIcon/index.js +29 -0
- package/lib/commonjs/components/CloseIcon/index.js.map +1 -0
- package/lib/commonjs/components/Filters/Filters.js +339 -0
- package/lib/commonjs/components/Filters/Filters.js.map +1 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.js +262 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.js.map +1 -0
- package/lib/commonjs/components/Filters/README.md +212 -0
- package/lib/commonjs/components/Filters/index.js +47 -0
- package/lib/commonjs/components/Filters/index.js.map +1 -0
- package/lib/commonjs/components/Input/Input.js +156 -0
- package/lib/commonjs/components/Input/Input.js.map +1 -0
- package/lib/commonjs/components/Input/README.md +128 -0
- package/lib/commonjs/components/Input/index.js +29 -0
- package/lib/commonjs/components/Input/index.js.map +1 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.js +65 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.js.map +1 -0
- package/lib/commonjs/components/LockOverlay/index.js +29 -0
- package/lib/commonjs/components/LockOverlay/index.js.map +1 -0
- package/lib/commonjs/components/Popup/Popup.js +296 -0
- package/lib/commonjs/components/Popup/Popup.js.map +1 -0
- package/lib/commonjs/components/Popup/README.md +133 -0
- package/lib/commonjs/components/Popup/index.js +29 -0
- package/lib/commonjs/components/Popup/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +121 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.js +29 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/RedemptionOption/README.md +148 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.js +111 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.js.map +1 -0
- package/lib/commonjs/components/RedemptionOption/index.js +29 -0
- package/lib/commonjs/components/RedemptionOption/index.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/README.md +119 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.js +153 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.js +28 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.js.map +1 -0
- package/lib/commonjs/components/ScratchCard/index.js +48 -0
- package/lib/commonjs/components/ScratchCard/index.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/README.md +187 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js +125 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js +207 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/index.js +48 -0
- package/lib/commonjs/components/UnlockRewards/index.js.map +1 -0
- package/lib/commonjs/components/Wheel/README.md +141 -0
- package/lib/commonjs/components/Wheel/Wheel.js +323 -0
- package/lib/commonjs/components/Wheel/Wheel.js.map +1 -0
- package/lib/commonjs/components/Wheel/index.js +29 -0
- package/lib/commonjs/components/Wheel/index.js.map +1 -0
- package/lib/commonjs/components/index.js +160 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/constants/BRANDS.js +57 -0
- package/lib/commonjs/constants/BRANDS.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/theme/Colors.js +120 -0
- package/lib/commonjs/theme/Colors.js.map +1 -0
- package/lib/commonjs/theme/ThemeContext.js +49 -0
- package/lib/commonjs/theme/ThemeContext.js.map +1 -0
- package/lib/commonjs/theme/index.js +28 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/module/app/_layout.js +36 -0
- package/lib/module/app/_layout.js.map +1 -0
- package/lib/module/app/index.js +143 -0
- package/lib/module/app/index.js.map +1 -0
- package/lib/module/assets/components/BannerWithDetails.png +0 -0
- package/lib/module/assets/components/DealCard-Horizontal.png +0 -0
- package/lib/module/assets/components/DealCard-Vertical.png +0 -0
- package/lib/module/assets/components/DealCard-floating.png +0 -0
- package/lib/module/assets/components/DealCard-nested.png +0 -0
- package/lib/module/assets/components/Filters.png +0 -0
- package/lib/module/assets/components/Popup-1.png +0 -0
- package/lib/module/assets/components/Popup-2.png +0 -0
- package/lib/module/assets/components/Popup-3.png +0 -0
- package/lib/module/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/lib/module/assets/components/RedemptionOption-Vertical.png +0 -0
- package/lib/module/assets/components/SimpleBanner.png +0 -0
- package/lib/module/assets/components/SimpleTrendingCard.png +0 -0
- package/lib/module/assets/components/SimpleTrendingCardV2.png +0 -0
- package/lib/module/assets/components/UnlockRewards-1.png +0 -0
- package/lib/module/assets/components/UnlockRewards-2.png +0 -0
- package/lib/module/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/lib/module/assets/images/adaptive-icon.png +0 -0
- package/lib/module/assets/images/face.jpg +0 -0
- package/lib/module/assets/images/favicon.png +0 -0
- package/lib/module/assets/images/giftvoucher.jpg +0 -0
- package/lib/module/assets/images/icon.png +0 -0
- package/lib/module/assets/images/insta.webp +0 -0
- package/lib/module/assets/images/muse.jpg +0 -0
- package/lib/module/assets/images/namshi-banner.png +0 -0
- package/lib/module/assets/images/namshi.webp +0 -0
- package/lib/module/assets/images/partial-react-logo.png +0 -0
- package/lib/module/assets/images/pb-logo.jpg +0 -0
- package/lib/module/assets/images/pb.jpg +0 -0
- package/lib/module/assets/images/react-logo.png +0 -0
- package/lib/module/assets/images/react-logo@2x.png +0 -0
- package/lib/module/assets/images/react-logo@3x.png +0 -0
- package/lib/module/assets/images/scratch_foreground.png +0 -0
- package/lib/module/assets/images/splash-icon.png +0 -0
- package/lib/module/assets/images/upgrade.png +0 -0
- package/lib/module/components/Badges/Badge.js +59 -0
- package/lib/module/components/Badges/Badge.js.map +1 -0
- package/lib/module/components/Badges/README.md +98 -0
- package/lib/module/components/Badges/index.js +5 -0
- package/lib/module/components/Badges/index.js.map +1 -0
- package/lib/module/components/Banner/Banner.js +130 -0
- package/lib/module/components/Banner/Banner.js.map +1 -0
- package/lib/module/components/Banner/BannerWithDetails.js +111 -0
- package/lib/module/components/Banner/BannerWithDetails.js.map +1 -0
- package/lib/module/components/Banner/README.md +101 -0
- package/lib/module/components/Banner/index.js +7 -0
- package/lib/module/components/Banner/index.js.map +1 -0
- package/lib/module/components/BrandIcon/BrandIcon.js +98 -0
- package/lib/module/components/BrandIcon/BrandIcon.js.map +1 -0
- package/lib/module/components/BrandIcon/index.js +5 -0
- package/lib/module/components/BrandIcon/index.js.map +1 -0
- package/lib/module/components/Card/Card.js +119 -0
- package/lib/module/components/Card/Card.js.map +1 -0
- package/lib/module/components/Card/CardContent.js +37 -0
- package/lib/module/components/Card/CardContent.js.map +1 -0
- package/lib/module/components/Card/CardFooter.js +29 -0
- package/lib/module/components/Card/CardFooter.js.map +1 -0
- package/lib/module/components/Card/CardHeader.js +72 -0
- package/lib/module/components/Card/CardHeader.js.map +1 -0
- package/lib/module/components/Card/CardImage.js +46 -0
- package/lib/module/components/Card/CardImage.js.map +1 -0
- package/lib/module/components/Card/index.js +18 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Card/templates/DealCard.js +183 -0
- package/lib/module/components/Card/templates/DealCard.js.map +1 -0
- package/lib/module/components/Card/templates/DealCardWithBackgroundImage.js +188 -0
- package/lib/module/components/Card/templates/DealCardWithBackgroundImage.js.map +1 -0
- package/lib/module/components/Card/templates/README.md +233 -0
- package/lib/module/components/Card/templates/SimpleTrendingCard.js +54 -0
- package/lib/module/components/Card/templates/SimpleTrendingCard.js.map +1 -0
- package/lib/module/components/Card/types.js +4 -0
- package/lib/module/components/Card/types.js.map +1 -0
- package/lib/module/components/CloseIcon/CloseIcon.js +63 -0
- package/lib/module/components/CloseIcon/CloseIcon.js.map +1 -0
- package/lib/module/components/CloseIcon/index.js +5 -0
- package/lib/module/components/CloseIcon/index.js.map +1 -0
- package/lib/module/components/Filters/Filters.js +330 -0
- package/lib/module/components/Filters/Filters.js.map +1 -0
- package/lib/module/components/Filters/PointsRangeSelector.js +256 -0
- package/lib/module/components/Filters/PointsRangeSelector.js.map +1 -0
- package/lib/module/components/Filters/README.md +212 -0
- package/lib/module/components/Filters/index.js +7 -0
- package/lib/module/components/Filters/index.js.map +1 -0
- package/lib/module/components/Input/Input.js +150 -0
- package/lib/module/components/Input/Input.js.map +1 -0
- package/lib/module/components/Input/README.md +128 -0
- package/lib/module/components/Input/index.js +5 -0
- package/lib/module/components/Input/index.js.map +1 -0
- package/lib/module/components/LockOverlay/LockOverlay.js +60 -0
- package/lib/module/components/LockOverlay/LockOverlay.js.map +1 -0
- package/lib/module/components/LockOverlay/index.js +5 -0
- package/lib/module/components/LockOverlay/index.js.map +1 -0
- package/lib/module/components/Popup/Popup.js +291 -0
- package/lib/module/components/Popup/Popup.js.map +1 -0
- package/lib/module/components/Popup/README.md +133 -0
- package/lib/module/components/Popup/index.js +5 -0
- package/lib/module/components/Popup/index.js.map +1 -0
- package/lib/module/components/ProgressBar/ProgressBar.js +116 -0
- package/lib/module/components/ProgressBar/ProgressBar.js.map +1 -0
- package/lib/module/components/ProgressBar/index.js +5 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/RedemptionOption/README.md +148 -0
- package/lib/module/components/RedemptionOption/RedemptionOption.js +106 -0
- package/lib/module/components/RedemptionOption/RedemptionOption.js.map +1 -0
- package/lib/module/components/RedemptionOption/index.js +5 -0
- package/lib/module/components/RedemptionOption/index.js.map +1 -0
- package/lib/module/components/ScratchCard/README.md +119 -0
- package/lib/module/components/ScratchCard/ScratchCard.js +147 -0
- package/lib/module/components/ScratchCard/ScratchCard.js.map +1 -0
- package/lib/module/components/ScratchCard/ScratchCardContent.js +24 -0
- package/lib/module/components/ScratchCard/ScratchCardContent.js.map +1 -0
- package/lib/module/components/ScratchCard/index.js +7 -0
- package/lib/module/components/ScratchCard/index.js.map +1 -0
- package/lib/module/components/UnlockRewards/README.md +187 -0
- package/lib/module/components/UnlockRewards/RewardItem.js +120 -0
- package/lib/module/components/UnlockRewards/RewardItem.js.map +1 -0
- package/lib/module/components/UnlockRewards/UnlockRewards.js +200 -0
- package/lib/module/components/UnlockRewards/UnlockRewards.js.map +1 -0
- package/lib/module/components/UnlockRewards/index.js +7 -0
- package/lib/module/components/UnlockRewards/index.js.map +1 -0
- package/lib/module/components/Wheel/README.md +141 -0
- package/lib/module/components/Wheel/Wheel.js +317 -0
- package/lib/module/components/Wheel/Wheel.js.map +1 -0
- package/lib/module/components/Wheel/index.js +5 -0
- package/lib/module/components/Wheel/index.js.map +1 -0
- package/lib/module/components/index.js +17 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/constants/BRANDS.js +53 -0
- package/lib/module/constants/BRANDS.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/theme/Colors.js +116 -0
- package/lib/module/theme/Colors.js.map +1 -0
- package/lib/module/theme/ThemeContext.js +41 -0
- package/lib/module/theme/ThemeContext.js.map +1 -0
- package/lib/module/theme/index.js +5 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/typescript/commonjs/app/_layout.d.ts +3 -0
- package/lib/typescript/commonjs/app/_layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/app/index.d.ts +3 -0
- package/lib/typescript/commonjs/app/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Badges/Badge.d.ts +16 -0
- package/lib/typescript/commonjs/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Badges/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +26 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/BannerWithDetails.d.ts +19 -0
- package/lib/typescript/commonjs/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BrandIcon/BrandIcon.d.ts +20 -0
- package/lib/typescript/commonjs/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BrandIcon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardContent.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardFooter.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardHeader.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/CardImage.d.ts +5 -0
- package/lib/typescript/commonjs/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +11 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCard.d.ts +33 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts +38 -0
- package/lib/typescript/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/templates/SimpleTrendingCard.d.ts +14 -0
- package/lib/typescript/commonjs/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/types.d.ts +78 -0
- package/lib/typescript/commonjs/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CloseIcon/CloseIcon.d.ts +16 -0
- package/lib/typescript/commonjs/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CloseIcon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/Filters.d.ts +74 -0
- package/lib/typescript/commonjs/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/PointsRangeSelector.d.ts +29 -0
- package/lib/typescript/commonjs/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Filters/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +23 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LockOverlay/LockOverlay.d.ts +16 -0
- package/lib/typescript/commonjs/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LockOverlay/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Popup/Popup.d.ts +38 -0
- package/lib/typescript/commonjs/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Popup/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +26 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/RedemptionOption/RedemptionOption.d.ts +24 -0
- package/lib/typescript/commonjs/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/RedemptionOption/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCard.d.ts +20 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCardContent.d.ts +8 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ScratchCard/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/RewardItem.d.ts +25 -0
- package/lib/typescript/commonjs/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/UnlockRewards.d.ts +59 -0
- package/lib/typescript/commonjs/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UnlockRewards/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts +34 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Wheel/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +15 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/constants/BRANDS.d.ts +7 -0
- package/lib/typescript/commonjs/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/theme/Colors.d.ts +28 -0
- package/lib/typescript/commonjs/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts +13 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +3 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/app/_layout.d.ts +3 -0
- package/lib/typescript/module/app/_layout.d.ts.map +1 -0
- package/lib/typescript/module/app/index.d.ts +3 -0
- package/lib/typescript/module/app/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Badges/Badge.d.ts +16 -0
- package/lib/typescript/module/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/module/components/Badges/index.d.ts +3 -0
- package/lib/typescript/module/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +26 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/BannerWithDetails.d.ts +19 -0
- package/lib/typescript/module/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/module/components/Banner/index.d.ts +5 -0
- package/lib/typescript/module/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/module/components/BrandIcon/BrandIcon.d.ts +20 -0
- package/lib/typescript/module/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/module/components/BrandIcon/index.d.ts +3 -0
- package/lib/typescript/module/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/Card.d.ts +5 -0
- package/lib/typescript/module/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardContent.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardFooter.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardHeader.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/CardImage.d.ts +5 -0
- package/lib/typescript/module/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/index.d.ts +11 -0
- package/lib/typescript/module/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/DealCard.d.ts +33 -0
- package/lib/typescript/module/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/DealCardWithBackgroundImage.d.ts +38 -0
- package/lib/typescript/module/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/templates/SimpleTrendingCard.d.ts +14 -0
- package/lib/typescript/module/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/types.d.ts +78 -0
- package/lib/typescript/module/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/module/components/CloseIcon/CloseIcon.d.ts +16 -0
- package/lib/typescript/module/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/module/components/CloseIcon/index.d.ts +3 -0
- package/lib/typescript/module/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/Filters.d.ts +74 -0
- package/lib/typescript/module/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/PointsRangeSelector.d.ts +29 -0
- package/lib/typescript/module/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/module/components/Filters/index.d.ts +5 -0
- package/lib/typescript/module/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/Input.d.ts +23 -0
- package/lib/typescript/module/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/index.d.ts +3 -0
- package/lib/typescript/module/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/module/components/LockOverlay/LockOverlay.d.ts +16 -0
- package/lib/typescript/module/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/module/components/LockOverlay/index.d.ts +3 -0
- package/lib/typescript/module/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Popup/Popup.d.ts +38 -0
- package/lib/typescript/module/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/module/components/Popup/index.d.ts +3 -0
- package/lib/typescript/module/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +26 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/module/components/RedemptionOption/RedemptionOption.d.ts +24 -0
- package/lib/typescript/module/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/module/components/RedemptionOption/index.d.ts +3 -0
- package/lib/typescript/module/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCard.d.ts +20 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCardContent.d.ts +8 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/module/components/ScratchCard/index.d.ts +5 -0
- package/lib/typescript/module/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/RewardItem.d.ts +25 -0
- package/lib/typescript/module/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/UnlockRewards.d.ts +59 -0
- package/lib/typescript/module/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/module/components/UnlockRewards/index.d.ts +5 -0
- package/lib/typescript/module/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts +34 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/module/components/Wheel/index.d.ts +3 -0
- package/lib/typescript/module/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +15 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/constants/BRANDS.d.ts +7 -0
- package/lib/typescript/module/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +3 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/theme/Colors.d.ts +28 -0
- package/lib/typescript/module/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts +13 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +3 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -0
- package/package.json +116 -0
- package/src/app/_layout.tsx +38 -0
- package/src/app/index.tsx +115 -0
- package/src/assets/components/BannerWithDetails.png +0 -0
- package/src/assets/components/DealCard-Horizontal.png +0 -0
- package/src/assets/components/DealCard-Vertical.png +0 -0
- package/src/assets/components/DealCard-floating.png +0 -0
- package/src/assets/components/DealCard-nested.png +0 -0
- package/src/assets/components/Filters.png +0 -0
- package/src/assets/components/Popup-1.png +0 -0
- package/src/assets/components/Popup-2.png +0 -0
- package/src/assets/components/Popup-3.png +0 -0
- package/src/assets/components/RedemptionOption-Horizontal.png +0 -0
- package/src/assets/components/RedemptionOption-Vertical.png +0 -0
- package/src/assets/components/SimpleBanner.png +0 -0
- package/src/assets/components/SimpleTrendingCard.png +0 -0
- package/src/assets/components/SimpleTrendingCardV2.png +0 -0
- package/src/assets/components/UnlockRewards-1.png +0 -0
- package/src/assets/components/UnlockRewards-2.png +0 -0
- package/src/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/src/assets/images/adaptive-icon.png +0 -0
- package/src/assets/images/face.jpg +0 -0
- package/src/assets/images/favicon.png +0 -0
- package/src/assets/images/giftvoucher.jpg +0 -0
- package/src/assets/images/icon.png +0 -0
- package/src/assets/images/insta.webp +0 -0
- package/src/assets/images/muse.jpg +0 -0
- package/src/assets/images/namshi-banner.png +0 -0
- package/src/assets/images/namshi.webp +0 -0
- package/src/assets/images/partial-react-logo.png +0 -0
- package/src/assets/images/pb-logo.jpg +0 -0
- package/src/assets/images/pb.jpg +0 -0
- package/src/assets/images/react-logo.png +0 -0
- package/src/assets/images/react-logo@2x.png +0 -0
- package/src/assets/images/react-logo@3x.png +0 -0
- package/src/assets/images/scratch_foreground.png +0 -0
- package/src/assets/images/splash-icon.png +0 -0
- package/src/assets/images/upgrade.png +0 -0
- package/src/components/Badges/Badge.tsx +81 -0
- package/src/components/Badges/README.md +98 -0
- package/src/components/Badges/index.ts +2 -0
- package/src/components/Banner/Banner.tsx +172 -0
- package/src/components/Banner/BannerWithDetails.tsx +133 -0
- package/src/components/Banner/README.md +101 -0
- package/src/components/Banner/index.ts +5 -0
- package/src/components/BrandIcon/BrandIcon.tsx +134 -0
- package/src/components/BrandIcon/index.ts +2 -0
- package/src/components/Card/Card.tsx +144 -0
- package/src/components/Card/CardContent.tsx +33 -0
- package/src/components/Card/CardFooter.tsx +33 -0
- package/src/components/Card/CardHeader.tsx +80 -0
- package/src/components/Card/CardImage.tsx +51 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Card/templates/DealCard.tsx +255 -0
- package/src/components/Card/templates/DealCardWithBackgroundImage.tsx +273 -0
- package/src/components/Card/templates/README.md +233 -0
- package/src/components/Card/templates/SimpleTrendingCard.tsx +54 -0
- package/src/components/Card/types.ts +75 -0
- package/src/components/CloseIcon/CloseIcon.tsx +77 -0
- package/src/components/CloseIcon/index.ts +2 -0
- package/src/components/Filters/Filters.tsx +427 -0
- package/src/components/Filters/PointsRangeSelector.tsx +319 -0
- package/src/components/Filters/README.md +212 -0
- package/src/components/Filters/index.ts +4 -0
- package/src/components/Input/Input.tsx +218 -0
- package/src/components/Input/README.md +128 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/LockOverlay/LockOverlay.tsx +82 -0
- package/src/components/LockOverlay/index.ts +2 -0
- package/src/components/Popup/Popup.tsx +374 -0
- package/src/components/Popup/README.md +133 -0
- package/src/components/Popup/index.ts +2 -0
- package/src/components/ProgressBar/ProgressBar.tsx +157 -0
- package/src/components/ProgressBar/index.ts +2 -0
- package/src/components/RedemptionOption/README.md +148 -0
- package/src/components/RedemptionOption/RedemptionOption.tsx +158 -0
- package/src/components/RedemptionOption/index.ts +2 -0
- package/src/components/ScratchCard/README.md +119 -0
- package/src/components/ScratchCard/ScratchCard.tsx +190 -0
- package/src/components/ScratchCard/ScratchCardContent.tsx +25 -0
- package/src/components/ScratchCard/index.ts +4 -0
- package/src/components/UnlockRewards/README.md +187 -0
- package/src/components/UnlockRewards/RewardItem.tsx +172 -0
- package/src/components/UnlockRewards/UnlockRewards.tsx +293 -0
- package/src/components/UnlockRewards/index.ts +4 -0
- package/src/components/Wheel/README.md +141 -0
- package/src/components/Wheel/Wheel.tsx +374 -0
- package/src/components/Wheel/index.ts +2 -0
- package/src/components/index.ts +14 -0
- package/src/constants/BRANDS.ts +64 -0
- package/src/index.ts +2 -0
- package/src/theme/Colors.ts +107 -0
- package/src/theme/ThemeContext.tsx +46 -0
- package/src/theme/index.ts +2 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# RedemptionOption Component
|
|
2
|
+
|
|
3
|
+
A flexible, customizable touchable option component for React Native applications with support for icons, vertical/horizontal layouts, active states, and extensive styling options.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { View } from 'react-native';
|
|
10
|
+
import { RedemptionOption } from '@your-org/component-library';
|
|
11
|
+
import { GiftIcon } from '@your-org/icons';
|
|
12
|
+
|
|
13
|
+
const RewardsScreen = () => {
|
|
14
|
+
return (
|
|
15
|
+
<View style={{ padding: 16 }}>
|
|
16
|
+
<RedemptionOption
|
|
17
|
+
icon={<GiftIcon size={24} color="#FFFFFF" />}
|
|
18
|
+
text="Redeem Points"
|
|
19
|
+
onPress={() => console.log('Option pressed')}
|
|
20
|
+
/>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default RewardsScreen;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Props
|
|
29
|
+
|
|
30
|
+
The `RedemptionOption` component provides extensive customization options through its props.
|
|
31
|
+
|
|
32
|
+
### Core Properties
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Required | Default | Description |
|
|
35
|
+
|------|------|----------|---------|-------------|
|
|
36
|
+
| `icon` | `React.ReactNode` | ✅ | - | Icon component to display in the option |
|
|
37
|
+
| `text` | `string` | ✅ | - | Text label to display with the icon |
|
|
38
|
+
|
|
39
|
+
### Layout & Appearance Properties
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Required | Default | Description |
|
|
42
|
+
|------|------|----------|---------|-------------|
|
|
43
|
+
| `orientation` | `"vertical" \| "horizontal"` | ❌ | `"vertical"` | Determines the layout direction of icon and text |
|
|
44
|
+
| `backgroundColor` | `string` | ❌ | theme.primary | Background color of the option |
|
|
45
|
+
| `textColor` | `string` | ❌ | theme.secondary | Color of the text label |
|
|
46
|
+
| `width` | `number \| string` | ❌ | - | Width of the option component |
|
|
47
|
+
| `height` | `number \| string` | ❌ | - | Height of the option component |
|
|
48
|
+
| `borderRadius` | `number` | ❌ | `8` | Corner radius of the option component |
|
|
49
|
+
| `padding` | `number` | ❌ | `12` | Padding inside the option component |
|
|
50
|
+
| `fontSize` | `number` | ❌ | `14` | Base font size for the text (actual size will be 90% of this value) |
|
|
51
|
+
|
|
52
|
+
### State Properties
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Required | Default | Description |
|
|
55
|
+
|------|------|----------|---------|-------------|
|
|
56
|
+
| `disabled` | `boolean` | ❌ | `false` | Whether the option is disabled (reduces opacity and prevents interaction) |
|
|
57
|
+
| `isActive` | `boolean` | ❌ | `false` | Whether the option is in active state (adds a border) |
|
|
58
|
+
| `activeOpacityValue` | `number` | ❌ | `0.7` | The opacity value when the button is pressed |
|
|
59
|
+
|
|
60
|
+
### Style Customization
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Required | Default | Description |
|
|
63
|
+
|------|------|----------|---------|-------------|
|
|
64
|
+
| `containerStyle` | `StyleProp<ViewStyle>` | ❌ | - | Style for the outer container |
|
|
65
|
+
| `textStyle` | `StyleProp<TextStyle>` | ❌ | - | Style for the text label |
|
|
66
|
+
| `iconContainerStyle` | `StyleProp<ViewStyle>` | ❌ | - | Style for the container around the icon |
|
|
67
|
+
|
|
68
|
+
### Behavior Props
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Required | Default | Description |
|
|
71
|
+
|------|------|----------|---------|-------------|
|
|
72
|
+
| `onPress` | `() => void` | ❌ | - | Function to call when the option is pressed |
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Vertical Layout (Default)
|
|
77
|
+
|
|
78
|
+
```jsx
|
|
79
|
+
<RedemptionOption
|
|
80
|
+
icon={<CoinIcon size={24} color="#FFD700" />}
|
|
81
|
+
text="Redeem Coins"
|
|
82
|
+
onPress={() => handleRedemption('coins')}
|
|
83
|
+
backgroundColor="#2C3E50"
|
|
84
|
+
textColor="#FFFFFF"
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Horizontal Layout
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
<RedemptionOption
|
|
92
|
+
icon={<TicketIcon size={20} color="#FF5722" />}
|
|
93
|
+
text="Movie Tickets"
|
|
94
|
+
orientation="horizontal"
|
|
95
|
+
onPress={() => handleRedemption('tickets')}
|
|
96
|
+
width="100%"
|
|
97
|
+
padding={16}
|
|
98
|
+
/>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Active State
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
<RedemptionOption
|
|
105
|
+
icon={<StarIcon size={22} color="#FFD700" />}
|
|
106
|
+
text="Premium Rewards"
|
|
107
|
+
isActive={selectedReward === 'premium'}
|
|
108
|
+
onPress={() => setSelectedReward('premium')}
|
|
109
|
+
backgroundColor="#1E88E5"
|
|
110
|
+
textColor="#FFFFFF"
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Disabled State
|
|
115
|
+
|
|
116
|
+
```jsx
|
|
117
|
+
<RedemptionOption
|
|
118
|
+
icon={<LockIcon size={20} color="#9E9E9E" />}
|
|
119
|
+
text="Locked Reward"
|
|
120
|
+
disabled={!hasEnoughPoints}
|
|
121
|
+
onPress={() => handleRedemption('locked')}
|
|
122
|
+
backgroundColor="#ECEFF1"
|
|
123
|
+
textColor="#757575"
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Custom Styling
|
|
128
|
+
|
|
129
|
+
```jsx
|
|
130
|
+
<RedemptionOption
|
|
131
|
+
icon={<GiftIcon size={28} color="#E91E63" />}
|
|
132
|
+
text="Special Offer"
|
|
133
|
+
containerStyle={{
|
|
134
|
+
shadowColor: '#000',
|
|
135
|
+
shadowOffset: { width: 0, height: 2 },
|
|
136
|
+
shadowOpacity: 0.3,
|
|
137
|
+
shadowRadius: 4,
|
|
138
|
+
elevation: 5,
|
|
139
|
+
}}
|
|
140
|
+
iconContainerStyle={{
|
|
141
|
+
backgroundColor: 'rgba(233, 30, 99, 0.1)',
|
|
142
|
+
borderRadius: 20,
|
|
143
|
+
padding: 8
|
|
144
|
+
}}
|
|
145
|
+
textStyle={{ fontWeight: 'bold', letterSpacing: 0.5 }}
|
|
146
|
+
onPress={() => handleSpecialOffer()}
|
|
147
|
+
/>
|
|
148
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _index = require("../../theme/index.js");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const RedemptionOption = ({
|
|
13
|
+
icon,
|
|
14
|
+
text,
|
|
15
|
+
orientation = "vertical",
|
|
16
|
+
backgroundColor,
|
|
17
|
+
textColor,
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
borderRadius = 8,
|
|
21
|
+
padding = 12,
|
|
22
|
+
fontSize = 14,
|
|
23
|
+
disabled = false,
|
|
24
|
+
isActive = false,
|
|
25
|
+
onPress,
|
|
26
|
+
containerStyle,
|
|
27
|
+
textStyle,
|
|
28
|
+
iconContainerStyle,
|
|
29
|
+
activeOpacityValue = 0.7
|
|
30
|
+
}) => {
|
|
31
|
+
const theme = (0, _index.useTheme)();
|
|
32
|
+
textColor = textColor || theme.onSurface;
|
|
33
|
+
// Dynamic styles based on props
|
|
34
|
+
let dynamicContainerStyle = {
|
|
35
|
+
backgroundColor: backgroundColor || theme.surface,
|
|
36
|
+
borderRadius,
|
|
37
|
+
padding,
|
|
38
|
+
borderWidth: isActive ? 2 : 0,
|
|
39
|
+
borderColor: isActive ? textColor : undefined
|
|
40
|
+
};
|
|
41
|
+
if (width) dynamicContainerStyle.width = width;
|
|
42
|
+
if (height) dynamicContainerStyle.height = height;
|
|
43
|
+
const dynamicTextStyle = {
|
|
44
|
+
color: textColor,
|
|
45
|
+
fontSize: fontSize * 0.9,
|
|
46
|
+
lineHeight: fontSize * 1.1
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
49
|
+
style: [styles.container, orientation === "vertical" ? styles.vertical : styles.horizontal, dynamicContainerStyle, disabled && styles.disabled, containerStyle],
|
|
50
|
+
onPress: onPress,
|
|
51
|
+
disabled: disabled,
|
|
52
|
+
activeOpacity: activeOpacityValue,
|
|
53
|
+
accessibilityRole: "button",
|
|
54
|
+
accessibilityState: {
|
|
55
|
+
disabled,
|
|
56
|
+
selected: isActive
|
|
57
|
+
},
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
59
|
+
style: [styles.iconContainer, orientation === "horizontal" && styles.iconHorizontal, iconContainerStyle],
|
|
60
|
+
children: icon
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
62
|
+
style: {
|
|
63
|
+
minHeight: 40,
|
|
64
|
+
justifyContent: "center"
|
|
65
|
+
},
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
67
|
+
style: [styles.text, orientation === "horizontal" ? {} : styles.textVertical, dynamicTextStyle, textStyle],
|
|
68
|
+
numberOfLines: 2,
|
|
69
|
+
ellipsizeMode: "tail",
|
|
70
|
+
adjustsFontSizeToFit: orientation === "vertical",
|
|
71
|
+
minimumFontScale: 0.8,
|
|
72
|
+
children: text
|
|
73
|
+
})
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const styles = _reactNative.StyleSheet.create({
|
|
78
|
+
container: {
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
justifyContent: "center"
|
|
81
|
+
},
|
|
82
|
+
vertical: {
|
|
83
|
+
flexDirection: "column",
|
|
84
|
+
justifyContent: "center"
|
|
85
|
+
},
|
|
86
|
+
horizontal: {
|
|
87
|
+
flexDirection: "row",
|
|
88
|
+
justifyContent: "flex-start",
|
|
89
|
+
alignItems: "center"
|
|
90
|
+
},
|
|
91
|
+
iconContainer: {
|
|
92
|
+
marginBottom: 8,
|
|
93
|
+
justifyContent: "center",
|
|
94
|
+
alignItems: "center"
|
|
95
|
+
},
|
|
96
|
+
iconHorizontal: {
|
|
97
|
+
marginBottom: 0,
|
|
98
|
+
marginRight: 12
|
|
99
|
+
},
|
|
100
|
+
text: {
|
|
101
|
+
fontWeight: "500"
|
|
102
|
+
},
|
|
103
|
+
textVertical: {
|
|
104
|
+
textAlign: "center"
|
|
105
|
+
},
|
|
106
|
+
disabled: {
|
|
107
|
+
opacity: 0.6
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
var _default = exports.default = RedemptionOption;
|
|
111
|
+
//# sourceMappingURL=RedemptionOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","_react","_interopRequireDefault","_reactNative","_jsxRuntime","e","__esModule","default","RedemptionOption","icon","text","orientation","backgroundColor","textColor","width","height","borderRadius","padding","fontSize","disabled","isActive","onPress","containerStyle","textStyle","iconContainerStyle","activeOpacityValue","theme","useTheme","onSurface","dynamicContainerStyle","surface","borderWidth","borderColor","undefined","dynamicTextStyle","color","lineHeight","jsxs","TouchableOpacity","style","styles","container","vertical","horizontal","activeOpacity","accessibilityRole","accessibilityState","selected","children","jsx","View","iconContainer","iconHorizontal","minHeight","justifyContent","Text","textVertical","numberOfLines","ellipsizeMode","adjustsFontSizeToFit","minimumFontScale","StyleSheet","create","alignItems","flexDirection","marginBottom","marginRight","fontWeight","textAlign","opacity","_default","exports"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RedemptionOption/RedemptionOption.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAA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CAACC,MAAM,CAAC;EAC/BrB,SAAS,EAAE;IACTsB,UAAU,EAAE,QAAQ;IACpBT,cAAc,EAAE;EAClB,CAAC;EACDZ,QAAQ,EAAE;IACRsB,aAAa,EAAE,QAAQ;IACvBV,cAAc,EAAE;EAClB,CAAC;EACDX,UAAU,EAAE;IACVqB,aAAa,EAAE,KAAK;IACpBV,cAAc,EAAE,YAAY;IAC5BS,UAAU,EAAC;EACb,CAAC;EACDZ,aAAa,EAAE;IACbc,YAAY,EAAE,CAAC;IACfX,cAAc,EAAE,QAAQ;IACxBS,UAAU,EAAE;EACd,CAAC;EACDX,cAAc,EAAE;IACda,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACDxD,IAAI,EAAE;IACJyD,UAAU,EAAE;EACd,CAAC;EACDX,YAAY,EAAE;IACZY,SAAS,EAAE;EACb,CAAC;EACDjD,QAAQ,EAAE;IACRkD,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhE,OAAA,GAEYC,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
RedemptionOption: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "RedemptionOption", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _RedemptionOption.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _RedemptionOption = _interopRequireWildcard(require("./RedemptionOption.js"));
|
|
16
|
+
Object.keys(_RedemptionOption).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _RedemptionOption[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _RedemptionOption[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_RedemptionOption","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RedemptionOption/index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAC,MAAA,CAAAC,IAAA,CAAAJ,iBAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,iBAAA,CAAAM,GAAA;EA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|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
## ScratchCard Documentation
|
|
2
|
+
|
|
3
|
+
The `ScratchCard` is an interactive component that creates a scratch-to-reveal experience commonly used for promotions, rewards, and gamification features. It leverages the Shopify React Native Skia library to provide a smooth scratching animation with customizable appearance. The component tracks scratching progress and can trigger an action when a sufficient area has been revealed.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import ScratchCard from "@/components/ScratchCard/ScratchCard";
|
|
9
|
+
import ScratchCardContent from "@/components/ScratchCard/ScratchCardContent";
|
|
10
|
+
import { Image, Text, View } from "react-native";
|
|
11
|
+
|
|
12
|
+
const MyComponent = () => {
|
|
13
|
+
const handleRevealed = () => {
|
|
14
|
+
// Handle card fully revealed action
|
|
15
|
+
console.log("Scratch card revealed!");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View style={{ width: 300, height: 200 }}>
|
|
20
|
+
<ScratchCard
|
|
21
|
+
image={require("@/assets/images/scratch_foreground.png")}
|
|
22
|
+
onScratched={handleRevealed}
|
|
23
|
+
brushStrokeWidth={40}
|
|
24
|
+
revealThreshold={0.7}
|
|
25
|
+
>
|
|
26
|
+
<ScratchCardContent>
|
|
27
|
+
<Image
|
|
28
|
+
source={require("@/assets/images/reward-banner.png")}
|
|
29
|
+
style={{ width: 250, height: 150 }}
|
|
30
|
+
/>
|
|
31
|
+
</ScratchCardContent>
|
|
32
|
+
</ScratchCard>
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default MyComponent;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Text-Based Example
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<ScratchCard
|
|
44
|
+
backgroundColor="#8A2BE2"
|
|
45
|
+
text="Scratch to reveal your prize!"
|
|
46
|
+
textFontColor="#FFFFFF"
|
|
47
|
+
textFontSize={18}
|
|
48
|
+
width={300}
|
|
49
|
+
height={150}
|
|
50
|
+
onScratched={() => alert("Congratulations! You won a prize!")}
|
|
51
|
+
>
|
|
52
|
+
<ScratchCardContent style={{ backgroundColor: "#FFD700" }}>
|
|
53
|
+
<Text style={{ fontSize: 24, fontWeight: "bold", color: "#000" }}>
|
|
54
|
+
50% OFF COUPON
|
|
55
|
+
</Text>
|
|
56
|
+
<Text style={{ marginTop: 8, color: "#333" }}>
|
|
57
|
+
Use code: SCRATCH50
|
|
58
|
+
</Text>
|
|
59
|
+
</ScratchCardContent>
|
|
60
|
+
</ScratchCard>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Props
|
|
64
|
+
|
|
65
|
+
#### Core Props
|
|
66
|
+
|
|
67
|
+
| Prop | Type | Default | Description |
|
|
68
|
+
|------|------|---------|-------------|
|
|
69
|
+
| `style` | `StyleProp<ViewStyle>` | `undefined` | Additional styles for the container |
|
|
70
|
+
| `children` | `React.ReactNode` | Required | Content to reveal underneath the scratch layer |
|
|
71
|
+
| `image` | `ImageRequireSource` | `null` | Image to use as the scratch layer |
|
|
72
|
+
| `width` | `number` | `300` | Width of the scratch card |
|
|
73
|
+
| `height` | `number` | `300` | Height of the scratch card |
|
|
74
|
+
| `onScratched` | `() => void` | `undefined` | Function to call when scratch threshold is reached |
|
|
75
|
+
|
|
76
|
+
#### Scratch Behavior Props
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Description |
|
|
79
|
+
|------|------|---------|-------------|
|
|
80
|
+
| `brushStrokeWidth` | `number` | `50` | Width of the scratching stroke |
|
|
81
|
+
| `revealThreshold` | `number` | `0.8` | Percentage (0.0-1.0) that needs to be scratched to trigger the reveal |
|
|
82
|
+
|
|
83
|
+
#### Appearance Props
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Default | Description |
|
|
86
|
+
|------|------|---------|-------------|
|
|
87
|
+
| `backgroundColor` | `string` | `"#CCCCCC"` | Background color of the scratch layer (used if no image is provided) |
|
|
88
|
+
| `text` | `string` | `""` | Optional text to display on the scratch layer |
|
|
89
|
+
| `textFont` | `ImageRequireSource` | `undefined` (required if text is present) | Font for the scratch layer text |
|
|
90
|
+
| `textFontColor` | `string` | `"#CCCCCC"` | Color for the scratch layer text |
|
|
91
|
+
| `textFontSize` | `number` | `16` | Font size for the scratch layer text |
|
|
92
|
+
|
|
93
|
+
### ScratchCardContent
|
|
94
|
+
|
|
95
|
+
The `ScratchCardContent` is a companion component that provides styling for the content underneath the scratch layer.
|
|
96
|
+
|
|
97
|
+
#### Usage
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import ScratchCardContent from "@/components/ScratchCard/ScratchCardContent";
|
|
101
|
+
|
|
102
|
+
<ScratchCardContent style={{ backgroundColor: "#f5f5f5" }}>
|
|
103
|
+
<Text>Your revealed content here</Text>
|
|
104
|
+
</ScratchCardContent>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### Props
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Default | Description |
|
|
110
|
+
|------|------|---------|-------------|
|
|
111
|
+
| `children` | `React.ReactNode` | Required | Content to display underneath the scratch layer |
|
|
112
|
+
| `style` | `StyleProp<ViewStyle>` | `undefined` | Additional styles for the content container |
|
|
113
|
+
|
|
114
|
+
### Related Components
|
|
115
|
+
|
|
116
|
+
- `ScratchCardContent`: Used for styling the revealed content
|
|
117
|
+
- `Image`: Used to display images in the scratch content or as the scratch layer
|
|
118
|
+
- `Text`: Used to display text in both the scratch layer and revealed content
|
|
119
|
+
- `View`: The foundation component for layout structure
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNativeSkia = require("@shopify/react-native-skia");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
const ScratchCard = ({
|
|
14
|
+
style,
|
|
15
|
+
children,
|
|
16
|
+
image = null,
|
|
17
|
+
brushStrokeWidth = 50,
|
|
18
|
+
revealThreshold = 0.8,
|
|
19
|
+
width = 300,
|
|
20
|
+
height = 300,
|
|
21
|
+
backgroundColor = "#CCCCCC",
|
|
22
|
+
text = "",
|
|
23
|
+
textFont,
|
|
24
|
+
textFontColor = "#CCCCCC",
|
|
25
|
+
textFontSize = 16,
|
|
26
|
+
onScratched
|
|
27
|
+
}) => {
|
|
28
|
+
const img = (0, _reactNativeSkia.useImage)(image);
|
|
29
|
+
const font = (0, _reactNativeSkia.useFont)(textFont, textFontSize);
|
|
30
|
+
const [[areaWidth, areaHeight], setSize] = (0, _react.useState)([0, 0]);
|
|
31
|
+
const [isScratched, setScratched] = (0, _react.useState)(false);
|
|
32
|
+
const [_, setRefresh] = (0, _react.useState)(0);
|
|
33
|
+
const path = (0, _react.useRef)(_reactNativeSkia.Skia.Path.Make());
|
|
34
|
+
const lastKnownY = (0, _react.useRef)(null);
|
|
35
|
+
|
|
36
|
+
//Check scratch progress
|
|
37
|
+
const checkScratchProgress = () => {
|
|
38
|
+
const bounds = path.current.getBounds();
|
|
39
|
+
const scratchedArea = bounds.height * bounds.width;
|
|
40
|
+
const totalArea = areaWidth * areaHeight;
|
|
41
|
+
if (scratchedArea / totalArea > revealThreshold && !isScratched) {
|
|
42
|
+
setScratched(true);
|
|
43
|
+
if (onScratched) {
|
|
44
|
+
onScratched();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//Handle path movement on canvas
|
|
50
|
+
const handleMove = nativeEvent => {
|
|
51
|
+
let {
|
|
52
|
+
locationX,
|
|
53
|
+
locationY
|
|
54
|
+
} = nativeEvent;
|
|
55
|
+
if (lastKnownY.current != null && nativeEvent.locationY - lastKnownY.current > 50) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
path.current.lineTo(locationX, locationY);
|
|
59
|
+
lastKnownY.current = locationY;
|
|
60
|
+
setRefresh(prev => prev + 1);
|
|
61
|
+
checkScratchProgress();
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
64
|
+
onLayout: e => {
|
|
65
|
+
setSize([e.nativeEvent.layout.width, e.nativeEvent.layout.height]);
|
|
66
|
+
},
|
|
67
|
+
style: [styles.container, style, {
|
|
68
|
+
width,
|
|
69
|
+
height
|
|
70
|
+
}],
|
|
71
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
72
|
+
style: styles.content,
|
|
73
|
+
children: children
|
|
74
|
+
}), !isScratched && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Canvas, {
|
|
75
|
+
style: styles.canvas,
|
|
76
|
+
onTouchStart: ({
|
|
77
|
+
nativeEvent
|
|
78
|
+
}) => {
|
|
79
|
+
path.current.moveTo(nativeEvent.locationX, nativeEvent.locationY);
|
|
80
|
+
setRefresh(prev => prev + 1);
|
|
81
|
+
},
|
|
82
|
+
onTouchMove: ({
|
|
83
|
+
nativeEvent
|
|
84
|
+
}) => handleMove(nativeEvent),
|
|
85
|
+
onTouchEnd: () => lastKnownY.current = null,
|
|
86
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Mask, {
|
|
87
|
+
mode: "luminance",
|
|
88
|
+
mask: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSkia.Group, {
|
|
89
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Rect, {
|
|
90
|
+
x: 0,
|
|
91
|
+
y: 0,
|
|
92
|
+
width: 1000,
|
|
93
|
+
height: 1000,
|
|
94
|
+
color: "white"
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Path, {
|
|
96
|
+
path: path.current,
|
|
97
|
+
color: "black",
|
|
98
|
+
style: "stroke",
|
|
99
|
+
strokeJoin: "round",
|
|
100
|
+
strokeCap: "round",
|
|
101
|
+
strokeWidth: brushStrokeWidth
|
|
102
|
+
})]
|
|
103
|
+
}),
|
|
104
|
+
children: img ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Image, {
|
|
105
|
+
image: img,
|
|
106
|
+
fit: "cover",
|
|
107
|
+
x: 0,
|
|
108
|
+
y: 0,
|
|
109
|
+
width: areaWidth,
|
|
110
|
+
height: areaHeight
|
|
111
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSkia.Group, {
|
|
112
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Rect, {
|
|
113
|
+
x: 0,
|
|
114
|
+
y: 0,
|
|
115
|
+
width: areaWidth,
|
|
116
|
+
height: areaHeight,
|
|
117
|
+
color: backgroundColor
|
|
118
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Text, {
|
|
119
|
+
x: areaWidth / 2 - (font?.measureText(text).width || 0) / 2,
|
|
120
|
+
y: areaHeight / 2 + (font?.measureText(text).height || 0) / 2,
|
|
121
|
+
text: text,
|
|
122
|
+
color: textFontColor,
|
|
123
|
+
font: font
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const styles = _reactNative.StyleSheet.create({
|
|
131
|
+
container: {
|
|
132
|
+
position: "relative",
|
|
133
|
+
overflow: "hidden",
|
|
134
|
+
width: "100%",
|
|
135
|
+
height: "100%"
|
|
136
|
+
},
|
|
137
|
+
content: {
|
|
138
|
+
position: "absolute",
|
|
139
|
+
top: 0,
|
|
140
|
+
left: 0,
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: "100%"
|
|
143
|
+
},
|
|
144
|
+
canvas: {
|
|
145
|
+
position: "absolute",
|
|
146
|
+
top: 0,
|
|
147
|
+
left: 0,
|
|
148
|
+
width: "100%",
|
|
149
|
+
height: "100%"
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
var _default = exports.default = ScratchCard;
|
|
153
|
+
//# sourceMappingURL=ScratchCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeSkia","_reactNative","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ScratchCard","style","children","image","brushStrokeWidth","revealThreshold","width","height","backgroundColor","text","textFont","textFontColor","textFontSize","onScratched","img","useImage","font","useFont","areaWidth","areaHeight","setSize","useState","isScratched","setScratched","_","setRefresh","path","useRef","Skia","Path","Make","lastKnownY","checkScratchProgress","bounds","current","getBounds","scratchedArea","totalArea","handleMove","nativeEvent","locationX","locationY","lineTo","prev","jsxs","View","onLayout","layout","styles","container","jsx","content","Canvas","canvas","onTouchStart","moveTo","onTouchMove","onTouchEnd","Mask","mode","mask","Group","Rect","x","y","color","strokeJoin","strokeCap","strokeWidth","Image","fit","Text","measureText","StyleSheet","create","position","overflow","top","left","_default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NC,IAAI,EAAE,CAAC;IACPxE,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,IAAAwE,QAAA,GAAAC,OAAA,CAAA9F,OAAA,GAEYc,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
const ScratchCardContent = ({
|
|
10
|
+
children,
|
|
11
|
+
style
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
14
|
+
style: [styles.card, style],
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const styles = _reactNative.StyleSheet.create({
|
|
19
|
+
card: {
|
|
20
|
+
backgroundColor: "#ffffff",
|
|
21
|
+
width: "100%",
|
|
22
|
+
height: "100%",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "center"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var _default = exports.default = ScratchCardContent;
|
|
28
|
+
//# sourceMappingURL=ScratchCardContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_jsxRuntime","ScratchCardContent","children","style","jsx","View","styles","card","StyleSheet","create","backgroundColor","width","height","alignItems","justifyContent","_default","exports","default"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ScratchCard/ScratchCardContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAsE,IAAAC,WAAA,GAAAD,OAAA;AAOtE,MAAME,kBAAqD,GAAGA,CAAC;EAC7DC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,oBAAO,IAAAH,WAAA,CAAAI,GAAA,EAACN,YAAA,CAAAO,IAAI;IAACF,KAAK,EAAE,CAACG,MAAM,CAACC,IAAI,EAAEJ,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAO,CAAC;AAC7D,CAAC;AAED,MAAMI,MAAM,GAAGE,uBAAU,CAACC,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJG,eAAe,EAAE,SAAS;IAC1BC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYhB,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
ScratchCard: true,
|
|
8
|
+
ScratchCardContent: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "ScratchCard", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ScratchCard.default;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "ScratchCardContent", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _ScratchCardContent.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var _ScratchCard = _interopRequireWildcard(require("./ScratchCard.js"));
|
|
23
|
+
Object.keys(_ScratchCard).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _ScratchCard[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _ScratchCard[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
var _ScratchCardContent = _interopRequireWildcard(require("./ScratchCardContent.js"));
|
|
35
|
+
Object.keys(_ScratchCardContent).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
+
if (key in exports && exports[key] === _ScratchCardContent[key]) return;
|
|
39
|
+
Object.defineProperty(exports, key, {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _ScratchCardContent[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
47
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
48
|
+
//# sourceMappingURL=index.js.map
|