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,158 @@
|
|
|
1
|
+
import { useTheme } from "../../theme";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
TouchableOpacity,
|
|
5
|
+
Text,
|
|
6
|
+
View,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
ViewStyle,
|
|
9
|
+
TextStyle,
|
|
10
|
+
StyleProp,
|
|
11
|
+
Dimensions,
|
|
12
|
+
DimensionValue,
|
|
13
|
+
} from "react-native";
|
|
14
|
+
|
|
15
|
+
interface RedemptionOptionProps {
|
|
16
|
+
// Required props
|
|
17
|
+
icon: React.ReactNode;
|
|
18
|
+
text: string;
|
|
19
|
+
|
|
20
|
+
// Customization props
|
|
21
|
+
orientation?: "vertical" | "horizontal";
|
|
22
|
+
backgroundColor?: string;
|
|
23
|
+
textColor?: string;
|
|
24
|
+
width?: number | string;
|
|
25
|
+
height?: number | string;
|
|
26
|
+
borderRadius?: number;
|
|
27
|
+
padding?: number;
|
|
28
|
+
fontSize?: number;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
isActive?: boolean;
|
|
31
|
+
onPress?: () => void;
|
|
32
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
33
|
+
textStyle?: StyleProp<TextStyle>;
|
|
34
|
+
iconContainerStyle?: StyleProp<ViewStyle>;
|
|
35
|
+
activeOpacityValue?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const RedemptionOption: React.FC<RedemptionOptionProps> = ({
|
|
39
|
+
icon,
|
|
40
|
+
text,
|
|
41
|
+
orientation = "vertical",
|
|
42
|
+
backgroundColor,
|
|
43
|
+
textColor,
|
|
44
|
+
width,
|
|
45
|
+
height,
|
|
46
|
+
borderRadius = 8,
|
|
47
|
+
padding = 12,
|
|
48
|
+
fontSize = 14,
|
|
49
|
+
disabled = false,
|
|
50
|
+
isActive = false,
|
|
51
|
+
onPress,
|
|
52
|
+
containerStyle,
|
|
53
|
+
textStyle,
|
|
54
|
+
iconContainerStyle,
|
|
55
|
+
activeOpacityValue = 0.7,
|
|
56
|
+
}) => {
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
|
|
59
|
+
textColor = textColor || theme.onSurface;
|
|
60
|
+
// Dynamic styles based on props
|
|
61
|
+
let dynamicContainerStyle: ViewStyle = {
|
|
62
|
+
backgroundColor: backgroundColor || theme.surface,
|
|
63
|
+
borderRadius,
|
|
64
|
+
padding,
|
|
65
|
+
borderWidth: isActive ? 2 : 0,
|
|
66
|
+
borderColor: isActive ? textColor : undefined,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (width) dynamicContainerStyle.width = width as DimensionValue;
|
|
70
|
+
if (height) dynamicContainerStyle.height = height as DimensionValue;
|
|
71
|
+
|
|
72
|
+
const dynamicTextStyle: TextStyle = {
|
|
73
|
+
color: textColor,
|
|
74
|
+
fontSize: fontSize * 0.9,
|
|
75
|
+
lineHeight: fontSize * 1.1,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<TouchableOpacity
|
|
80
|
+
style={[
|
|
81
|
+
styles.container,
|
|
82
|
+
orientation === "vertical" ? styles.vertical : styles.horizontal,
|
|
83
|
+
dynamicContainerStyle,
|
|
84
|
+
disabled && styles.disabled,
|
|
85
|
+
containerStyle,
|
|
86
|
+
]}
|
|
87
|
+
onPress={onPress}
|
|
88
|
+
disabled={disabled}
|
|
89
|
+
activeOpacity={activeOpacityValue}
|
|
90
|
+
accessibilityRole="button"
|
|
91
|
+
accessibilityState={{ disabled, selected: isActive }}
|
|
92
|
+
>
|
|
93
|
+
<View
|
|
94
|
+
style={[
|
|
95
|
+
styles.iconContainer,
|
|
96
|
+
orientation === "horizontal" && styles.iconHorizontal,
|
|
97
|
+
iconContainerStyle,
|
|
98
|
+
]}
|
|
99
|
+
>
|
|
100
|
+
{icon}
|
|
101
|
+
</View>
|
|
102
|
+
<View style={{minHeight: 40, justifyContent:"center"}}>
|
|
103
|
+
<Text
|
|
104
|
+
style={[
|
|
105
|
+
styles.text,
|
|
106
|
+
orientation === "horizontal"
|
|
107
|
+
? {}
|
|
108
|
+
: styles.textVertical,
|
|
109
|
+
dynamicTextStyle,
|
|
110
|
+
textStyle,
|
|
111
|
+
]}
|
|
112
|
+
numberOfLines={2}
|
|
113
|
+
ellipsizeMode="tail"
|
|
114
|
+
adjustsFontSizeToFit={orientation === "vertical"}
|
|
115
|
+
minimumFontScale={0.8}
|
|
116
|
+
>
|
|
117
|
+
{text}
|
|
118
|
+
</Text>
|
|
119
|
+
</View>
|
|
120
|
+
</TouchableOpacity>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const styles = StyleSheet.create({
|
|
125
|
+
container: {
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
justifyContent: "center"
|
|
128
|
+
},
|
|
129
|
+
vertical: {
|
|
130
|
+
flexDirection: "column",
|
|
131
|
+
justifyContent: "center",
|
|
132
|
+
},
|
|
133
|
+
horizontal: {
|
|
134
|
+
flexDirection: "row",
|
|
135
|
+
justifyContent: "flex-start",
|
|
136
|
+
alignItems:"center"
|
|
137
|
+
},
|
|
138
|
+
iconContainer: {
|
|
139
|
+
marginBottom: 8,
|
|
140
|
+
justifyContent: "center",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
},
|
|
143
|
+
iconHorizontal: {
|
|
144
|
+
marginBottom: 0,
|
|
145
|
+
marginRight: 12,
|
|
146
|
+
},
|
|
147
|
+
text: {
|
|
148
|
+
fontWeight: "500",
|
|
149
|
+
},
|
|
150
|
+
textVertical: {
|
|
151
|
+
textAlign: "center",
|
|
152
|
+
},
|
|
153
|
+
disabled: {
|
|
154
|
+
opacity: 0.6,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export default RedemptionOption;
|
|
@@ -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,190 @@
|
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Canvas,
|
|
4
|
+
Group,
|
|
5
|
+
Image,
|
|
6
|
+
Mask,
|
|
7
|
+
Path,
|
|
8
|
+
Rect,
|
|
9
|
+
Skia,
|
|
10
|
+
LinearGradient,
|
|
11
|
+
vec,
|
|
12
|
+
useImage,
|
|
13
|
+
Text,
|
|
14
|
+
useFont,
|
|
15
|
+
} from "@shopify/react-native-skia";
|
|
16
|
+
import {
|
|
17
|
+
StyleProp,
|
|
18
|
+
View,
|
|
19
|
+
ViewStyle,
|
|
20
|
+
StyleSheet,
|
|
21
|
+
ImageRequireSource,
|
|
22
|
+
NativeTouchEvent,
|
|
23
|
+
} from "react-native";
|
|
24
|
+
|
|
25
|
+
type ScratchCardProps = {
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
image?: ImageRequireSource;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
brushStrokeWidth?: number;
|
|
30
|
+
revealThreshold?: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
backgroundColor?: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
textFont?: ImageRequireSource;
|
|
36
|
+
textFontSize?: number;
|
|
37
|
+
textFontColor?: string;
|
|
38
|
+
onScratched?: () => void;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const ScratchCard: React.FC<ScratchCardProps> = ({
|
|
42
|
+
style,
|
|
43
|
+
children,
|
|
44
|
+
image = null,
|
|
45
|
+
brushStrokeWidth = 50,
|
|
46
|
+
revealThreshold = 0.8,
|
|
47
|
+
width = 300,
|
|
48
|
+
height = 300,
|
|
49
|
+
backgroundColor = "#CCCCCC",
|
|
50
|
+
text = "",
|
|
51
|
+
textFont,
|
|
52
|
+
textFontColor = "#CCCCCC",
|
|
53
|
+
textFontSize = 16,
|
|
54
|
+
onScratched,
|
|
55
|
+
}) => {
|
|
56
|
+
const img = useImage(image);
|
|
57
|
+
const font = useFont(textFont, textFontSize);
|
|
58
|
+
|
|
59
|
+
const [[areaWidth, areaHeight], setSize] = useState([0, 0]);
|
|
60
|
+
const [isScratched, setScratched] = useState(false);
|
|
61
|
+
const [_, setRefresh] = useState(0);
|
|
62
|
+
|
|
63
|
+
const path = useRef(Skia.Path.Make());
|
|
64
|
+
const lastKnownY = useRef<number | null>(null);
|
|
65
|
+
|
|
66
|
+
//Check scratch progress
|
|
67
|
+
const checkScratchProgress = () => {
|
|
68
|
+
const bounds = path.current.getBounds();
|
|
69
|
+
const scratchedArea = bounds.height * bounds.width;
|
|
70
|
+
const totalArea = areaWidth * areaHeight;
|
|
71
|
+
|
|
72
|
+
if (scratchedArea / totalArea > revealThreshold && !isScratched) {
|
|
73
|
+
setScratched(true);
|
|
74
|
+
if (onScratched) {
|
|
75
|
+
onScratched();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//Handle path movement on canvas
|
|
81
|
+
const handleMove = (nativeEvent: NativeTouchEvent) => {
|
|
82
|
+
let { locationX, locationY } = nativeEvent;
|
|
83
|
+
|
|
84
|
+
if (
|
|
85
|
+
lastKnownY.current != null &&
|
|
86
|
+
nativeEvent.locationY - lastKnownY.current > 50
|
|
87
|
+
) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
path.current.lineTo(locationX, locationY);
|
|
92
|
+
lastKnownY.current = locationY;
|
|
93
|
+
|
|
94
|
+
setRefresh((prev) => prev + 1);
|
|
95
|
+
checkScratchProgress();
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View
|
|
100
|
+
onLayout={(e) => {
|
|
101
|
+
setSize([e.nativeEvent.layout.width, e.nativeEvent.layout.height]);
|
|
102
|
+
}}
|
|
103
|
+
style={[styles.container, style, { width, height }]}
|
|
104
|
+
>
|
|
105
|
+
<View style={styles.content}>{children}</View>
|
|
106
|
+
|
|
107
|
+
{!isScratched && (
|
|
108
|
+
<Canvas
|
|
109
|
+
style={styles.canvas}
|
|
110
|
+
onTouchStart={({ nativeEvent }) => {
|
|
111
|
+
path.current.moveTo(nativeEvent.locationX, nativeEvent.locationY);
|
|
112
|
+
setRefresh((prev) => prev + 1);
|
|
113
|
+
}}
|
|
114
|
+
onTouchMove={({ nativeEvent }) => handleMove(nativeEvent)}
|
|
115
|
+
onTouchEnd={() => (lastKnownY.current = null)}
|
|
116
|
+
>
|
|
117
|
+
<Mask
|
|
118
|
+
mode="luminance"
|
|
119
|
+
mask={
|
|
120
|
+
<Group>
|
|
121
|
+
<Rect x={0} y={0} width={1000} height={1000} color="white" />
|
|
122
|
+
<Path
|
|
123
|
+
path={path.current}
|
|
124
|
+
color="black"
|
|
125
|
+
style="stroke"
|
|
126
|
+
strokeJoin="round"
|
|
127
|
+
strokeCap="round"
|
|
128
|
+
strokeWidth={brushStrokeWidth}
|
|
129
|
+
/>
|
|
130
|
+
</Group>
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
{img ? (
|
|
134
|
+
<Image
|
|
135
|
+
image={img}
|
|
136
|
+
fit="cover"
|
|
137
|
+
x={0}
|
|
138
|
+
y={0}
|
|
139
|
+
width={areaWidth}
|
|
140
|
+
height={areaHeight}
|
|
141
|
+
/>
|
|
142
|
+
) : (
|
|
143
|
+
<Group>
|
|
144
|
+
<Rect
|
|
145
|
+
x={0}
|
|
146
|
+
y={0}
|
|
147
|
+
width={areaWidth}
|
|
148
|
+
height={areaHeight}
|
|
149
|
+
color={backgroundColor}
|
|
150
|
+
/>
|
|
151
|
+
<Text
|
|
152
|
+
x={areaWidth / 2 - (font?.measureText(text).width || 0) / 2}
|
|
153
|
+
y={areaHeight / 2 + (font?.measureText(text).height || 0) / 2}
|
|
154
|
+
text={text}
|
|
155
|
+
color={textFontColor}
|
|
156
|
+
font={font}
|
|
157
|
+
/>
|
|
158
|
+
</Group>
|
|
159
|
+
)}
|
|
160
|
+
</Mask>
|
|
161
|
+
</Canvas>
|
|
162
|
+
)}
|
|
163
|
+
</View>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const styles = StyleSheet.create({
|
|
168
|
+
container: {
|
|
169
|
+
position: "relative",
|
|
170
|
+
overflow: "hidden",
|
|
171
|
+
width: "100%",
|
|
172
|
+
height: "100%",
|
|
173
|
+
},
|
|
174
|
+
content: {
|
|
175
|
+
position: "absolute",
|
|
176
|
+
top: 0,
|
|
177
|
+
left: 0,
|
|
178
|
+
width: "100%",
|
|
179
|
+
height: "100%",
|
|
180
|
+
},
|
|
181
|
+
canvas: {
|
|
182
|
+
position: "absolute",
|
|
183
|
+
top: 0,
|
|
184
|
+
left: 0,
|
|
185
|
+
width: "100%",
|
|
186
|
+
height: "100%",
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
export default ScratchCard;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle, View, StyleSheet } from "react-native";
|
|
2
|
+
|
|
3
|
+
type ScratchCardContentProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const ScratchCardContent: React.FC<ScratchCardContentProps> = ({
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
}) => {
|
|
12
|
+
return <View style={[styles.card, style]}>{children}</View>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
card: {
|
|
17
|
+
backgroundColor: "#ffffff",
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "100%",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default ScratchCardContent;
|