related-ui-components 1.9.6 → 1.9.8
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.js +161 -0
- package/lib/commonjs/app.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 +67 -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 +138 -0
- package/lib/commonjs/components/Banner/Banner.js.map +1 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.js +120 -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 +115 -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/Button/Button.js +124 -0
- package/lib/commonjs/components/Button/Button.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +29 -0
- package/lib/commonjs/components/Button/index.js.map +1 -0
- package/lib/commonjs/components/Card/Card.js +116 -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 +79 -0
- package/lib/commonjs/components/Card/CardHeader.js.map +1 -0
- package/lib/commonjs/components/Card/CardImage.js +52 -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 +194 -0
- package/lib/commonjs/components/Card/templates/DealCard.js.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.js +237 -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 +75 -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/DateRangePicker/DateRangePicker.js +358 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js.map +1 -0
- package/lib/commonjs/components/DateRangePicker/index.js +4 -0
- package/lib/commonjs/components/DateRangePicker/index.js.map +1 -0
- package/lib/commonjs/components/Filters/Filters.js +345 -0
- package/lib/commonjs/components/Filters/Filters.js.map +1 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.js +264 -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 +48 -0
- package/lib/commonjs/components/Filters/index.js.map +1 -0
- package/lib/commonjs/components/Input/Input.js +161 -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/Marquee/Marquee.js +105 -0
- package/lib/commonjs/components/Marquee/Marquee.js.map +1 -0
- package/lib/commonjs/components/Marquee/index.js +29 -0
- package/lib/commonjs/components/Marquee/index.js.map +1 -0
- package/lib/commonjs/components/NumericStepper/NumericStepper.js +103 -0
- package/lib/commonjs/components/NumericStepper/NumericStepper.js.map +1 -0
- package/lib/commonjs/components/NumericStepper/index.js +29 -0
- package/lib/commonjs/components/NumericStepper/index.js.map +1 -0
- package/lib/commonjs/components/Popup/Popup.js +342 -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 +125 -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/RedeemedVoucher/RedeemedVoucherSheet.js +459 -0
- package/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.js.map +1 -0
- package/lib/commonjs/components/RedeemedVoucher/index.js +29 -0
- package/lib/commonjs/components/RedeemedVoucher/index.js.map +1 -0
- package/lib/commonjs/components/RedemptionOption/README.md +148 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.js +132 -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 +222 -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/SelectAmount/SelectAmount.js +189 -0
- package/lib/commonjs/components/SelectAmount/SelectAmount.js.map +1 -0
- package/lib/commonjs/components/SelectAmount/index.js +4 -0
- package/lib/commonjs/components/SelectAmount/index.js.map +1 -0
- package/lib/commonjs/components/Skeleton/Shimmer.js +75 -0
- package/lib/commonjs/components/Skeleton/Shimmer.js.map +1 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.js +36 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.js.map +1 -0
- package/lib/commonjs/components/Skeleton/index.js +48 -0
- package/lib/commonjs/components/Skeleton/index.js.map +1 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.js +98 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.js +370 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.js +347 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.js +257 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.js +290 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.js +246 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/README.md +421 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.js +181 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.js +115 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.js +261 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/index.js +22 -0
- package/lib/commonjs/components/TravelBooking/index.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/types.js +15 -0
- package/lib/commonjs/components/TravelBooking/types.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/README.md +187 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js +129 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js +230 -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 +361 -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 +204 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/constants/BRANDS.js +58 -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 +154 -0
- package/lib/commonjs/theme/Colors.js.map +1 -0
- package/lib/commonjs/theme/ThemeContext.js +57 -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/theme/ThemeContext.js +7 -2
- package/lib/module/theme/ThemeContext.js.map +1 -1
- package/lib/typescript/lib/commonjs/app.d.ts +4 -0
- package/lib/typescript/lib/commonjs/app.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Badges/Badge.d.ts +14 -0
- package/lib/typescript/lib/commonjs/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Badges/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Banner/Banner.d.ts +24 -0
- package/lib/typescript/lib/commonjs/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Banner/BannerWithDetails.d.ts +16 -0
- package/lib/typescript/lib/commonjs/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Banner/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/BrandIcon/BrandIcon.d.ts +18 -0
- package/lib/typescript/lib/commonjs/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/BrandIcon/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Button/Button.d.ts +17 -0
- package/lib/typescript/lib/commonjs/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Button/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/Card.d.ts +17 -0
- package/lib/typescript/lib/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/CardContent.d.ts +8 -0
- package/lib/typescript/lib/commonjs/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/CardFooter.d.ts +9 -0
- package/lib/typescript/lib/commonjs/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/CardHeader.d.ts +14 -0
- package/lib/typescript/lib/commonjs/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/CardImage.d.ts +12 -0
- package/lib/typescript/lib/commonjs/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/index.d.ts +10 -0
- package/lib/typescript/lib/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/DealCard.d.ts +30 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts +37 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/SimpleTrendingCard.d.ts +12 -0
- package/lib/typescript/lib/commonjs/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Card/types.d.ts +2 -0
- package/lib/typescript/lib/commonjs/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/CloseIcon/CloseIcon.d.ts +14 -0
- package/lib/typescript/lib/commonjs/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/CloseIcon/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/DateRangePicker/DateRangePicker.d.ts +20 -0
- package/lib/typescript/lib/commonjs/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/DateRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Filters/Filters.d.ts +56 -0
- package/lib/typescript/lib/commonjs/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Filters/PointsRangeSelector.d.ts +27 -0
- package/lib/typescript/lib/commonjs/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Filters/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Input/Input.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Input/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/LockOverlay/LockOverlay.d.ts +15 -0
- package/lib/typescript/lib/commonjs/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/LockOverlay/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Marquee/Marquee.d.ts +14 -0
- package/lib/typescript/lib/commonjs/components/Marquee/Marquee.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Marquee/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Marquee/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/NumericStepper/NumericStepper.d.ts +16 -0
- package/lib/typescript/lib/commonjs/components/NumericStepper/NumericStepper.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/NumericStepper/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/NumericStepper/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Popup/Popup.d.ts +39 -0
- package/lib/typescript/lib/commonjs/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Popup/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ProgressBar/ProgressBar.d.ts +22 -0
- package/lib/typescript/lib/commonjs/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/RedeemedVoucher/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/RedeemedVoucher/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/RedemptionOption/RedemptionOption.d.ts +23 -0
- package/lib/typescript/lib/commonjs/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/RedemptionOption/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/ScratchCard.d.ts +19 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/ScratchCardContent.d.ts +7 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/SelectAmount/SelectAmount.d.ts +29 -0
- package/lib/typescript/lib/commonjs/components/SelectAmount/SelectAmount.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/SelectAmount/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/Shimmer.d.ts +11 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/Shimmer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/SkeletonElement.d.ts +10 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/SkeletonElement.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Suggestions/SuggestionList.d.ts +12 -0
- package/lib/typescript/lib/commonjs/components/Suggestions/SuggestionList.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/CarRentalForm.d.ts +52 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/CarRentalForm.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/FlightForm.d.ts +47 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/FlightForm.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/FlightSummary.d.ts +32 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/FlightSummary.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/HotelForm.d.ts +45 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/HotelForm.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/HotelSummary.d.ts +36 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/HotelSummary.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/SummaryBar.d.ts +12 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/SummaryBar.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/TabSelector.d.ts +15 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/TabSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/TravelBooking.d.ts +47 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/TravelBooking.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/types.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/TravelBooking/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/RewardItem.d.ts +23 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/UnlockRewards.d.ts +41 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Wheel/Wheel.d.ts +25 -0
- package/lib/typescript/lib/commonjs/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/Wheel/index.d.ts +3 -0
- package/lib/typescript/lib/commonjs/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/components/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/constants/BRANDS.d.ts +14 -0
- package/lib/typescript/lib/commonjs/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/theme/Colors.d.ts +110 -0
- package/lib/typescript/lib/commonjs/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/theme/ThemeContext.d.ts +11 -0
- package/lib/typescript/lib/commonjs/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/theme/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/app.d.ts.map +1 -0
- package/lib/typescript/src/components/Badges/Badge.d.ts.map +1 -0
- package/lib/typescript/src/components/Badges/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/src/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/typescript/src/components/Banner/index.d.ts.map +1 -0
- package/lib/typescript/src/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/CardContent.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/CardImage.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/typescript/src/components/Card/types.d.ts.map +1 -0
- package/lib/typescript/src/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/DateRangePicker/index.d.ts +2 -0
- package/lib/typescript/src/components/DateRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Filters/Filters.d.ts.map +1 -0
- package/lib/typescript/src/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/typescript/src/components/Filters/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/src/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Marquee/Marquee.d.ts.map +1 -0
- package/lib/typescript/src/components/Marquee/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NumericStepper/NumericStepper.d.ts.map +1 -0
- package/lib/typescript/src/components/NumericStepper/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/src/components/Popup/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/src/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/RedeemedVoucher/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/typescript/src/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/typescript/src/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/typescript/src/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/typescript/src/components/SelectAmount/SelectAmount.d.ts.map +1 -0
- package/lib/typescript/src/components/SelectAmount/index.d.ts +2 -0
- package/lib/typescript/src/components/SelectAmount/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/Shimmer.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/SkeletonElement.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Suggestions/SuggestionList.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/CarRentalForm.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/FlightForm.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/FlightSummary.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/HotelForm.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/HotelSummary.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/SummaryBar.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/TabSelector.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/TravelBooking.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/index.d.ts +2 -0
- package/lib/typescript/src/components/TravelBooking/index.d.ts.map +1 -0
- package/lib/typescript/src/components/TravelBooking/types.d.ts.map +1 -0
- package/lib/typescript/src/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/typescript/src/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/typescript/src/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/typescript/src/components/Wheel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/constants/BRANDS.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/Colors.d.ts.map +1 -0
- package/lib/typescript/{theme → src/theme}/ThemeContext.d.ts +2 -0
- package/lib/typescript/src/theme/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/theme/ThemeContext.tsx +8 -0
- package/lib/typescript/app.d.ts.map +0 -1
- package/lib/typescript/components/Badges/Badge.d.ts.map +0 -1
- package/lib/typescript/components/Badges/index.d.ts.map +0 -1
- package/lib/typescript/components/Banner/Banner.d.ts.map +0 -1
- package/lib/typescript/components/Banner/BannerWithDetails.d.ts.map +0 -1
- package/lib/typescript/components/Banner/index.d.ts.map +0 -1
- package/lib/typescript/components/BrandIcon/BrandIcon.d.ts.map +0 -1
- package/lib/typescript/components/BrandIcon/index.d.ts.map +0 -1
- package/lib/typescript/components/Button/Button.d.ts.map +0 -1
- package/lib/typescript/components/Button/index.d.ts.map +0 -1
- package/lib/typescript/components/Card/Card.d.ts.map +0 -1
- package/lib/typescript/components/Card/CardContent.d.ts.map +0 -1
- package/lib/typescript/components/Card/CardFooter.d.ts.map +0 -1
- package/lib/typescript/components/Card/CardHeader.d.ts.map +0 -1
- package/lib/typescript/components/Card/CardImage.d.ts.map +0 -1
- package/lib/typescript/components/Card/index.d.ts.map +0 -1
- package/lib/typescript/components/Card/templates/DealCard.d.ts.map +0 -1
- package/lib/typescript/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +0 -1
- package/lib/typescript/components/Card/templates/SimpleTrendingCard.d.ts.map +0 -1
- package/lib/typescript/components/Card/types.d.ts.map +0 -1
- package/lib/typescript/components/CloseIcon/CloseIcon.d.ts.map +0 -1
- package/lib/typescript/components/CloseIcon/index.d.ts.map +0 -1
- package/lib/typescript/components/DateRangePicker/DateRangePicker.d.ts.map +0 -1
- package/lib/typescript/components/DateRangePicker/index.d.ts.map +0 -1
- package/lib/typescript/components/Filters/Filters.d.ts.map +0 -1
- package/lib/typescript/components/Filters/PointsRangeSelector.d.ts.map +0 -1
- package/lib/typescript/components/Filters/index.d.ts.map +0 -1
- package/lib/typescript/components/Input/Input.d.ts.map +0 -1
- package/lib/typescript/components/Input/index.d.ts.map +0 -1
- package/lib/typescript/components/LockOverlay/LockOverlay.d.ts.map +0 -1
- package/lib/typescript/components/LockOverlay/index.d.ts.map +0 -1
- package/lib/typescript/components/Marquee/Marquee.d.ts.map +0 -1
- package/lib/typescript/components/Marquee/index.d.ts.map +0 -1
- package/lib/typescript/components/NumericStepper/NumericStepper.d.ts.map +0 -1
- package/lib/typescript/components/NumericStepper/index.d.ts.map +0 -1
- package/lib/typescript/components/Popup/Popup.d.ts.map +0 -1
- package/lib/typescript/components/Popup/index.d.ts.map +0 -1
- package/lib/typescript/components/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/lib/typescript/components/ProgressBar/index.d.ts.map +0 -1
- package/lib/typescript/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +0 -1
- package/lib/typescript/components/RedeemedVoucher/index.d.ts.map +0 -1
- package/lib/typescript/components/RedemptionOption/RedemptionOption.d.ts.map +0 -1
- package/lib/typescript/components/RedemptionOption/index.d.ts.map +0 -1
- package/lib/typescript/components/ScratchCard/ScratchCard.d.ts.map +0 -1
- package/lib/typescript/components/ScratchCard/ScratchCardContent.d.ts.map +0 -1
- package/lib/typescript/components/ScratchCard/index.d.ts.map +0 -1
- package/lib/typescript/components/SelectAmount/SelectAmount.d.ts.map +0 -1
- package/lib/typescript/components/SelectAmount/index.d.ts.map +0 -1
- package/lib/typescript/components/Skeleton/Shimmer.d.ts.map +0 -1
- package/lib/typescript/components/Skeleton/SkeletonElement.d.ts.map +0 -1
- package/lib/typescript/components/Skeleton/index.d.ts.map +0 -1
- package/lib/typescript/components/Suggestions/SuggestionList.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/CarRentalForm.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/FlightForm.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/FlightSummary.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/HotelForm.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/HotelSummary.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/SummaryBar.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/TabSelector.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/TravelBooking.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/index.d.ts.map +0 -1
- package/lib/typescript/components/TravelBooking/types.d.ts.map +0 -1
- package/lib/typescript/components/UnlockRewards/RewardItem.d.ts.map +0 -1
- package/lib/typescript/components/UnlockRewards/UnlockRewards.d.ts.map +0 -1
- package/lib/typescript/components/UnlockRewards/index.d.ts.map +0 -1
- package/lib/typescript/components/Wheel/Wheel.d.ts.map +0 -1
- package/lib/typescript/components/Wheel/index.d.ts.map +0 -1
- package/lib/typescript/components/index.d.ts.map +0 -1
- package/lib/typescript/constants/BRANDS.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/theme/Colors.d.ts.map +0 -1
- package/lib/typescript/theme/ThemeContext.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts.map +0 -1
- /package/lib/typescript/{components → lib/commonjs/components}/DateRangePicker/index.d.ts +0 -0
- /package/lib/typescript/{components → lib/commonjs/components}/SelectAmount/index.d.ts +0 -0
- /package/lib/typescript/{components → lib/commonjs/components}/TravelBooking/index.d.ts +0 -0
- /package/lib/typescript/{app.d.ts → src/app.d.ts} +0 -0
- /package/lib/typescript/{components → src/components}/Badges/Badge.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Badges/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Banner/Banner.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Banner/BannerWithDetails.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Banner/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/BrandIcon/BrandIcon.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/BrandIcon/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Button/Button.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Button/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/Card.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/CardContent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/CardFooter.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/CardHeader.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/CardImage.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/templates/DealCard.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/templates/DealCardWithBackgroundImage.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/templates/SimpleTrendingCard.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Card/types.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/CloseIcon/CloseIcon.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/CloseIcon/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/DateRangePicker/DateRangePicker.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Filters/Filters.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Filters/PointsRangeSelector.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Filters/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Input/Input.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Input/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/LockOverlay/LockOverlay.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/LockOverlay/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Marquee/Marquee.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Marquee/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/NumericStepper/NumericStepper.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/NumericStepper/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Popup/Popup.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Popup/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ProgressBar/ProgressBar.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ProgressBar/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RedeemedVoucher/RedeemedVoucherSheet.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RedeemedVoucher/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RedemptionOption/RedemptionOption.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/RedemptionOption/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ScratchCard/ScratchCard.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ScratchCard/ScratchCardContent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/ScratchCard/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/SelectAmount/SelectAmount.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Skeleton/Shimmer.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Skeleton/SkeletonElement.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Skeleton/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Suggestions/SuggestionList.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/CarRentalForm.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/FlightForm.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/FlightSummary.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/HotelForm.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/HotelSummary.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/SummaryBar.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/TabSelector.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/TravelBooking.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/TravelBooking/types.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UnlockRewards/RewardItem.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UnlockRewards/UnlockRewards.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UnlockRewards/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Wheel/Wheel.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/Wheel/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/index.d.ts +0 -0
- /package/lib/typescript/{constants → src/constants}/BRANDS.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{theme → src/theme}/Colors.d.ts +0 -0
- /package/lib/typescript/{theme → src/theme}/index.d.ts +0 -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,132 @@
|
|
|
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
|
+
isRTL
|
|
31
|
+
}) => {
|
|
32
|
+
const {
|
|
33
|
+
theme,
|
|
34
|
+
isRTL: rtl
|
|
35
|
+
} = (0, _index.useTheme)();
|
|
36
|
+
isRTL = isRTL || rtl;
|
|
37
|
+
textColor = textColor || theme.onSurface;
|
|
38
|
+
|
|
39
|
+
// Dynamic styles based on props
|
|
40
|
+
let dynamicContainerStyle = {
|
|
41
|
+
backgroundColor: backgroundColor || theme.surface,
|
|
42
|
+
borderRadius,
|
|
43
|
+
padding,
|
|
44
|
+
borderWidth: isActive ? 2 : 0,
|
|
45
|
+
borderColor: isActive ? textColor : undefined
|
|
46
|
+
};
|
|
47
|
+
if (width) dynamicContainerStyle.width = width;
|
|
48
|
+
if (height) dynamicContainerStyle.height = height;
|
|
49
|
+
const dynamicTextStyle = {
|
|
50
|
+
color: textColor,
|
|
51
|
+
fontSize: fontSize * 0.9,
|
|
52
|
+
lineHeight: fontSize * 1.1
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Determine horizontal flex direction based on RTL
|
|
56
|
+
const horizontalDirection = {
|
|
57
|
+
flexDirection: isRTL ? 'row-reverse' : 'row',
|
|
58
|
+
justifyContent: "flex-start",
|
|
59
|
+
alignItems: "center"
|
|
60
|
+
};
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
62
|
+
style: [styles.container, orientation === "vertical" ? styles.vertical : horizontalDirection, dynamicContainerStyle, disabled && styles.disabled, containerStyle],
|
|
63
|
+
onPress: onPress,
|
|
64
|
+
disabled: disabled,
|
|
65
|
+
activeOpacity: activeOpacityValue,
|
|
66
|
+
accessibilityRole: "button",
|
|
67
|
+
accessibilityState: {
|
|
68
|
+
disabled,
|
|
69
|
+
selected: isActive
|
|
70
|
+
},
|
|
71
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
72
|
+
style: [styles.iconContainer, orientation === "horizontal" && (isRTL ? {
|
|
73
|
+
marginLeft: 12,
|
|
74
|
+
marginRight: 0
|
|
75
|
+
} : {
|
|
76
|
+
marginRight: 12,
|
|
77
|
+
marginLeft: 0
|
|
78
|
+
}), iconContainerStyle],
|
|
79
|
+
children: icon
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
81
|
+
style: {
|
|
82
|
+
minHeight: 40,
|
|
83
|
+
justifyContent: "center"
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
86
|
+
style: [styles.text, orientation === "horizontal" ? {} : styles.textVertical, dynamicTextStyle, textStyle],
|
|
87
|
+
numberOfLines: 2,
|
|
88
|
+
ellipsizeMode: "tail",
|
|
89
|
+
adjustsFontSizeToFit: orientation === "vertical",
|
|
90
|
+
minimumFontScale: 0.8,
|
|
91
|
+
children: text
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const styles = _reactNative.StyleSheet.create({
|
|
97
|
+
container: {
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
justifyContent: "center"
|
|
100
|
+
},
|
|
101
|
+
vertical: {
|
|
102
|
+
flexDirection: "column",
|
|
103
|
+
justifyContent: "center"
|
|
104
|
+
},
|
|
105
|
+
horizontal: {
|
|
106
|
+
// Base horizontal style is now handled dynamically with RTL support
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
justifyContent: "flex-start",
|
|
109
|
+
alignItems: "center"
|
|
110
|
+
},
|
|
111
|
+
iconContainer: {
|
|
112
|
+
// marginBottom: 8,
|
|
113
|
+
justifyContent: "center",
|
|
114
|
+
alignItems: "center"
|
|
115
|
+
},
|
|
116
|
+
iconHorizontal: {
|
|
117
|
+
// This is now handled dynamically with RTL support
|
|
118
|
+
marginBottom: 0,
|
|
119
|
+
marginRight: 12
|
|
120
|
+
},
|
|
121
|
+
text: {
|
|
122
|
+
fontWeight: "500"
|
|
123
|
+
},
|
|
124
|
+
textVertical: {
|
|
125
|
+
textAlign: "center"
|
|
126
|
+
},
|
|
127
|
+
disabled: {
|
|
128
|
+
opacity: 0.6
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
var _default = exports.default = RedemptionOption;
|
|
132
|
+
//# 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","isRTL","theme","rtl","useTheme","onSurface","dynamicContainerStyle","surface","borderWidth","borderColor","undefined","dynamicTextStyle","color","lineHeight","horizontalDirection","flexDirection","justifyContent","alignItems","jsxs","TouchableOpacity","style","styles","container","vertical","activeOpacity","accessibilityRole","accessibilityState","selected","children","jsx","View","iconContainer","marginLeft","marginRight","minHeight","Text","textVertical","numberOfLines","ellipsizeMode","adjustsFontSizeToFit","minimumFontScale","StyleSheet","create","horizontal","iconHorizontal","marginBottom","fontWeight","textAlign","opacity","_default","exports"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RedemptionOption/RedemptionOption.tsx"],"mappings":"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","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;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,iBAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAAmC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAf,wBAAAe,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAL,GAAA,CAAAE,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAtB,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAuB,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,OAAAnB,cAAA,CAAAC,IAAA,CAAAO,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAtB,MAAA,CAAAuB,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAd,GAAA,IAAAc,CAAA,CAAAC,GAAA,IAAA1B,MAAA,CAAAS,cAAA,CAAAW,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA","ignoreList":[]}
|
|
@@ -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` | `ImageSourcePropType` | `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` | `ImageSourcePropType` | `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,222 @@
|
|
|
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 _reactNativeReanimated = require("react-native-reanimated");
|
|
11
|
+
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const ScratchCard = ({
|
|
16
|
+
style,
|
|
17
|
+
children,
|
|
18
|
+
image,
|
|
19
|
+
brushStrokeWidth = 50,
|
|
20
|
+
revealThreshold = 0.8,
|
|
21
|
+
width = 300,
|
|
22
|
+
height = 300,
|
|
23
|
+
backgroundColor = "#CCCCCC",
|
|
24
|
+
text = "",
|
|
25
|
+
textFont,
|
|
26
|
+
textFontColor = "#CCCCCC",
|
|
27
|
+
textFontSize = 16,
|
|
28
|
+
onScratched,
|
|
29
|
+
gradient
|
|
30
|
+
}) => {
|
|
31
|
+
const loadedImg = (0, _reactNativeSkia.useImage)(image);
|
|
32
|
+
const loadedFont = (0, _reactNativeSkia.useFont)(textFont, textFontSize);
|
|
33
|
+
const [[areaWidth, areaHeight], setSize] = (0, _react.useState)([0, 0]);
|
|
34
|
+
const [isScratched, setScratched] = (0, _react.useState)(false);
|
|
35
|
+
const [isLayoutReady, setLayoutReady] = (0, _react.useState)(false);
|
|
36
|
+
const isThresholdReached = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
37
|
+
const path = (0, _reactNativeReanimated.useSharedValue)(_reactNativeSkia.Skia.Path.Make());
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
39
|
+
path.value = _reactNativeSkia.Skia.Path.Make();
|
|
40
|
+
isThresholdReached.value = false;
|
|
41
|
+
setScratched(false);
|
|
42
|
+
}, [areaWidth, areaHeight]);
|
|
43
|
+
const handleLayout = (0, _react.useCallback)(event => {
|
|
44
|
+
const {
|
|
45
|
+
width: newWidth,
|
|
46
|
+
height: newHeight
|
|
47
|
+
} = event.nativeEvent.layout;
|
|
48
|
+
if (newWidth > 0 && newHeight > 0) {
|
|
49
|
+
if (newWidth !== areaWidth || newHeight !== areaHeight) {
|
|
50
|
+
setSize([newWidth, newHeight]);
|
|
51
|
+
}
|
|
52
|
+
if (!isLayoutReady) {
|
|
53
|
+
setLayoutReady(true);
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
setLayoutReady(false);
|
|
57
|
+
}
|
|
58
|
+
}, [areaWidth, areaHeight, isLayoutReady]);
|
|
59
|
+
const revealCardOnJS = (0, _react.useCallback)(() => {
|
|
60
|
+
setScratched(true);
|
|
61
|
+
onScratched?.();
|
|
62
|
+
}, [onScratched]);
|
|
63
|
+
const pan = _reactNativeGestureHandler.Gesture.Pan().averageTouches(true).maxPointers(1).onBegin(e => {
|
|
64
|
+
if (!isLayoutReady) return;
|
|
65
|
+
try {
|
|
66
|
+
const newPath = path.value.copy();
|
|
67
|
+
newPath.moveTo(e.x, e.y);
|
|
68
|
+
newPath.lineTo(e.x + 0.001, e.y + 0.001);
|
|
69
|
+
path.value = newPath;
|
|
70
|
+
(0, _reactNativeSkia.notifyChange)(path);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error("ScratchCard: Error in onBegin:", error);
|
|
73
|
+
}
|
|
74
|
+
}).onChange(e => {
|
|
75
|
+
if (!isLayoutReady || isThresholdReached.value) return;
|
|
76
|
+
try {
|
|
77
|
+
const newPath = path.value.copy();
|
|
78
|
+
newPath.lineTo(e.x, e.y);
|
|
79
|
+
path.value = newPath;
|
|
80
|
+
(0, _reactNativeSkia.notifyChange)(path);
|
|
81
|
+
const bounds = path.value.getBounds();
|
|
82
|
+
if (!bounds || areaWidth <= 0 || areaHeight <= 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const scratchedArea = bounds.width * bounds.height;
|
|
86
|
+
const totalArea = areaWidth * areaHeight;
|
|
87
|
+
if (totalArea > 0 && scratchedArea / totalArea > revealThreshold) {
|
|
88
|
+
if (!isThresholdReached.value) {
|
|
89
|
+
isThresholdReached.value = true;
|
|
90
|
+
(0, _reactNativeReanimated.runOnJS)(revealCardOnJS)();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error("ScratchCard: Error in onChange (UI Thread):", error);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const textMetrics = _react.default.useMemo(() => {
|
|
98
|
+
if (loadedFont && text && areaWidth > 0 && areaHeight > 0) {
|
|
99
|
+
const metrics = loadedFont.measureText(text);
|
|
100
|
+
const textX = areaWidth / 2 - metrics.width / 2;
|
|
101
|
+
const textY = areaHeight / 2 + metrics.height / 3;
|
|
102
|
+
return {
|
|
103
|
+
x: textX,
|
|
104
|
+
y: textY,
|
|
105
|
+
width: metrics.width,
|
|
106
|
+
height: metrics.height
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}, [loadedFont, text, areaWidth, areaHeight]);
|
|
111
|
+
const canRenderCanvas = isLayoutReady && areaWidth > 0 && areaHeight > 0;
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureHandlerRootView, {
|
|
113
|
+
style: {
|
|
114
|
+
justifyContent: "center",
|
|
115
|
+
alignContent: "center"
|
|
116
|
+
},
|
|
117
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
118
|
+
onLayout: handleLayout,
|
|
119
|
+
style: [styles.container, style, {
|
|
120
|
+
width,
|
|
121
|
+
height
|
|
122
|
+
}],
|
|
123
|
+
children: [canRenderCanvas && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
124
|
+
style: styles.content,
|
|
125
|
+
children: children
|
|
126
|
+
}), !isScratched && canRenderCanvas && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
|
|
127
|
+
gesture: pan,
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Canvas, {
|
|
129
|
+
style: styles.canvas,
|
|
130
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Mask, {
|
|
131
|
+
mode: "luminance",
|
|
132
|
+
mask: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSkia.Group, {
|
|
133
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Rect, {
|
|
134
|
+
x: 0,
|
|
135
|
+
y: 0,
|
|
136
|
+
width: areaWidth,
|
|
137
|
+
height: areaHeight,
|
|
138
|
+
color: "white"
|
|
139
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Path, {
|
|
140
|
+
path: path,
|
|
141
|
+
color: "black",
|
|
142
|
+
style: "stroke",
|
|
143
|
+
strokeJoin: "round",
|
|
144
|
+
strokeCap: "round",
|
|
145
|
+
strokeWidth: brushStrokeWidth
|
|
146
|
+
})]
|
|
147
|
+
}),
|
|
148
|
+
children: loadedImg ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Image, {
|
|
149
|
+
image: loadedImg,
|
|
150
|
+
fit: "cover",
|
|
151
|
+
x: 0,
|
|
152
|
+
y: 0,
|
|
153
|
+
width: areaWidth,
|
|
154
|
+
height: areaHeight
|
|
155
|
+
}) : gradient ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSkia.Group, {
|
|
156
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.LinearGradient, {
|
|
157
|
+
start: gradient.start ?? {
|
|
158
|
+
x: 0,
|
|
159
|
+
y: 0
|
|
160
|
+
},
|
|
161
|
+
end: gradient.end ?? {
|
|
162
|
+
x: areaWidth,
|
|
163
|
+
y: areaHeight
|
|
164
|
+
},
|
|
165
|
+
colors: gradient.colors
|
|
166
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Rect, {
|
|
167
|
+
x: 0,
|
|
168
|
+
y: 0,
|
|
169
|
+
width: areaWidth,
|
|
170
|
+
height: areaHeight
|
|
171
|
+
}), loadedFont && textMetrics && text ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Text, {
|
|
172
|
+
x: textMetrics.x,
|
|
173
|
+
y: textMetrics.y,
|
|
174
|
+
text: text,
|
|
175
|
+
color: textFontColor,
|
|
176
|
+
font: loadedFont
|
|
177
|
+
}) : null]
|
|
178
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSkia.Group, {
|
|
179
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Rect, {
|
|
180
|
+
x: 0,
|
|
181
|
+
y: 0,
|
|
182
|
+
width: areaWidth,
|
|
183
|
+
height: areaHeight,
|
|
184
|
+
color: backgroundColor
|
|
185
|
+
}), loadedFont && textMetrics && text ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSkia.Text, {
|
|
186
|
+
x: textMetrics.x,
|
|
187
|
+
y: textMetrics.y,
|
|
188
|
+
text: text,
|
|
189
|
+
color: textFontColor,
|
|
190
|
+
font: loadedFont
|
|
191
|
+
}) : null]
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
const styles = _reactNative.StyleSheet.create({
|
|
200
|
+
container: {
|
|
201
|
+
position: "relative",
|
|
202
|
+
overflow: "hidden"
|
|
203
|
+
},
|
|
204
|
+
content: {
|
|
205
|
+
position: "absolute",
|
|
206
|
+
top: 0,
|
|
207
|
+
left: 0,
|
|
208
|
+
width: "100%",
|
|
209
|
+
height: "100%",
|
|
210
|
+
zIndex: 1
|
|
211
|
+
},
|
|
212
|
+
canvas: {
|
|
213
|
+
position: "absolute",
|
|
214
|
+
top: 0,
|
|
215
|
+
left: 0,
|
|
216
|
+
width: "100%",
|
|
217
|
+
height: "100%",
|
|
218
|
+
zIndex: 2
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
var _default = exports.default = ScratchCard;
|
|
222
|
+
//# sourceMappingURL=ScratchCard.js.map
|