@tap-payments/click-to-pay-button-web 0.0.1-test
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/LICENSE +21 -0
- package/README.md +62 -0
- package/build/@types/authenticate.d.ts +138 -0
- package/build/@types/authenticate.js +1 -0
- package/build/@types/cardButtonProps.d.ts +11 -0
- package/build/@types/cardButtonProps.js +1 -0
- package/build/@types/cardWeb.d.ts +161 -0
- package/build/@types/cardWeb.js +1 -0
- package/build/@types/click2pay.d.ts +11 -0
- package/build/@types/click2pay.js +11 -0
- package/build/@types/clickToPay/checkoutResponseData.d.ts +14 -0
- package/build/@types/clickToPay/checkoutResponseData.js +1 -0
- package/build/@types/clickToPay/click2PayCard.d.ts +56 -0
- package/build/@types/clickToPay/click2PayCard.js +1 -0
- package/build/@types/clickToPay/complianceSettings.d.ts +12 -0
- package/build/@types/clickToPay/complianceSettings.js +1 -0
- package/build/@types/clickToPay/consumer.d.ts +9 -0
- package/build/@types/clickToPay/consumer.js +1 -0
- package/build/@types/clickToPay/dpaData.d.ts +7 -0
- package/build/@types/clickToPay/dpaData.js +1 -0
- package/build/@types/clickToPay/dpaTransactionOptions.d.ts +31 -0
- package/build/@types/clickToPay/dpaTransactionOptions.js +1 -0
- package/build/@types/clickToPay/events/checkoutWithCard.d.ts +24 -0
- package/build/@types/clickToPay/events/checkoutWithCard.js +1 -0
- package/build/@types/clickToPay/events/checkoutWithNewCard.d.ts +26 -0
- package/build/@types/clickToPay/events/checkoutWithNewCard.js +1 -0
- package/build/@types/clickToPay/events/encryptCard.d.ts +26 -0
- package/build/@types/clickToPay/events/encryptCard.js +1 -0
- package/build/@types/clickToPay/events/errors.d.ts +15 -0
- package/build/@types/clickToPay/events/errors.js +12 -0
- package/build/@types/clickToPay/events/getCards.d.ts +4 -0
- package/build/@types/clickToPay/events/getCards.js +1 -0
- package/build/@types/clickToPay/events/idLookup.d.ts +16 -0
- package/build/@types/clickToPay/events/idLookup.js +1 -0
- package/build/@types/clickToPay/events/index.d.ts +23 -0
- package/build/@types/clickToPay/events/index.js +1 -0
- package/build/@types/clickToPay/events/init.d.ts +20 -0
- package/build/@types/clickToPay/events/init.js +1 -0
- package/build/@types/clickToPay/events/initiateValidation.d.ts +19 -0
- package/build/@types/clickToPay/events/initiateValidation.js +1 -0
- package/build/@types/clickToPay/events/signOut.d.ts +8 -0
- package/build/@types/clickToPay/events/signOut.js +1 -0
- package/build/@types/clickToPay/events/validate.d.ts +8 -0
- package/build/@types/clickToPay/events/validate.js +1 -0
- package/build/@types/clickToPay/maskedCard.d.ts +16 -0
- package/build/@types/clickToPay/maskedCard.js +1 -0
- package/build/@types/clickToPay/maskedConsumer.d.ts +21 -0
- package/build/@types/clickToPay/maskedConsumer.js +1 -0
- package/build/@types/clickToPay/mastercardCheckoutServicesObject.d.ts +61 -0
- package/build/@types/clickToPay/mastercardCheckoutServicesObject.js +1 -0
- package/build/@types/enum.d.ts +19 -0
- package/build/@types/enum.js +23 -0
- package/build/@types/error.d.ts +14 -0
- package/build/@types/error.js +1 -0
- package/build/@types/index.d.ts +6 -0
- package/build/@types/index.js +6 -0
- package/build/@types/tapCountry.d.ts +30 -0
- package/build/@types/tapCountry.js +1 -0
- package/build/@types/tapLocalisation.d.ts +193 -0
- package/build/@types/tapLocalisation.js +1 -0
- package/build/@types/tapTheme.d.ts +842 -0
- package/build/@types/tapTheme.js +1 -0
- package/build/@types/utils.d.ts +6 -0
- package/build/@types/utils.js +1 -0
- package/build/api.d.ts +3 -0
- package/build/api.js +30 -0
- package/build/assets/gif/error-black.gif +0 -0
- package/build/assets/gif/error-white.gif +0 -0
- package/build/assets/gif/success-black.gif +0 -0
- package/build/assets/gif/success-white.gif +0 -0
- package/build/assets/locales/locale.json +517 -0
- package/build/components/ActionButton/ActionButton.d.ts +20 -0
- package/build/components/ActionButton/ActionButton.js +35 -0
- package/build/components/ActionButton/index.d.ts +2 -0
- package/build/components/ActionButton/index.js +2 -0
- package/build/components/Banner/BannerError.d.ts +6 -0
- package/build/components/Banner/BannerError.js +36 -0
- package/build/components/Banner/index.d.ts +1 -0
- package/build/components/Banner/index.js +1 -0
- package/build/components/Button/Button.d.ts +5 -0
- package/build/components/Button/Button.js +23 -0
- package/build/components/Button/index.d.ts +2 -0
- package/build/components/Button/index.js +2 -0
- package/build/components/ChipButton/ChipButton.d.ts +15 -0
- package/build/components/ChipButton/ChipButton.js +49 -0
- package/build/components/ChipButton/index.d.ts +2 -0
- package/build/components/ChipButton/index.js +2 -0
- package/build/components/CountrySelect/CountrySelect.d.ts +8 -0
- package/build/components/CountrySelect/CountrySelect.js +27 -0
- package/build/components/CountrySelect/index.d.ts +2 -0
- package/build/components/CountrySelect/index.js +2 -0
- package/build/components/DragScrollableImageList/DragScrollableImageList.d.ts +6 -0
- package/build/components/DragScrollableImageList/DragScrollableImageList.js +27 -0
- package/build/components/DragScrollableImageList/index.d.ts +2 -0
- package/build/components/DragScrollableImageList/index.js +2 -0
- package/build/components/Icons/AnimatedCheckIcon.d.ts +8 -0
- package/build/components/Icons/AnimatedCheckIcon.js +33 -0
- package/build/components/Icons/CheckboxCheckedIcon.d.ts +7 -0
- package/build/components/Icons/CheckboxCheckedIcon.js +19 -0
- package/build/components/Icons/CheckboxIcon.d.ts +7 -0
- package/build/components/Icons/CheckboxIcon.js +19 -0
- package/build/components/Icons/ExclamationIcon.d.ts +8 -0
- package/build/components/Icons/ExclamationIcon.js +19 -0
- package/build/components/Icons/InfoIcon.d.ts +7 -0
- package/build/components/Icons/InfoIcon.js +10 -0
- package/build/components/Icons/MemoIcon.d.ts +8 -0
- package/build/components/Icons/MemoIcon.js +23 -0
- package/build/components/Icons/index.d.ts +6 -0
- package/build/components/Icons/index.js +6 -0
- package/build/components/Loader/Loader.d.ts +13 -0
- package/build/components/Loader/Loader.js +24 -0
- package/build/components/Loader/index.d.ts +2 -0
- package/build/components/Loader/index.js +2 -0
- package/build/components/OTPInput/OTPInput.d.ts +13 -0
- package/build/components/OTPInput/OTPInput.js +97 -0
- package/build/components/OTPInput/index.d.ts +2 -0
- package/build/components/OTPInput/index.js +2 -0
- package/build/components/OTPInputAdapter/OTPInputAdapter.d.ts +14 -0
- package/build/components/OTPInputAdapter/OTPInputAdapter.js +146 -0
- package/build/components/OTPInputAdapter/index.d.ts +3 -0
- package/build/components/OTPInputAdapter/index.js +3 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +11 -0
- package/build/components/OTPTimer/OTPTimer.js +58 -0
- package/build/components/OTPTimer/hooks/useTimer.d.ts +8 -0
- package/build/components/OTPTimer/hooks/useTimer.js +28 -0
- package/build/components/OTPTimer/index.d.ts +1 -0
- package/build/components/OTPTimer/index.js +1 -0
- package/build/components/PhoneInput/PhoneInput.d.ts +8 -0
- package/build/components/PhoneInput/PhoneInput.js +71 -0
- package/build/components/PhoneInput/index.d.ts +2 -0
- package/build/components/PhoneInput/index.js +2 -0
- package/build/components/SkeletonLoader/SkeletonLoader.d.ts +4 -0
- package/build/components/SkeletonLoader/SkeletonLoader.js +50 -0
- package/build/components/SkeletonLoader/index.d.ts +2 -0
- package/build/components/SkeletonLoader/index.js +2 -0
- package/build/components/Text/Text.d.ts +5 -0
- package/build/components/Text/Text.js +17 -0
- package/build/components/Text/index.d.ts +2 -0
- package/build/components/Text/index.js +2 -0
- package/build/components/TooltipAdapter/TooltipAdapter.d.ts +7 -0
- package/build/components/TooltipAdapter/TooltipAdapter.js +63 -0
- package/build/components/TooltipAdapter/index.d.ts +2 -0
- package/build/components/TooltipAdapter/index.js +2 -0
- package/build/configs/dark.d.ts +958 -0
- package/build/configs/dark.js +958 -0
- package/build/configs/light.d.ts +960 -0
- package/build/configs/light.js +960 -0
- package/build/configs/locale.d.ts +517 -0
- package/build/configs/locale.js +517 -0
- package/build/constants/baseConfigs.d.ts +2 -0
- package/build/constants/baseConfigs.js +4 -0
- package/build/constants/click2pay.d.ts +16 -0
- package/build/constants/click2pay.js +16 -0
- package/build/constants/countries.d.ts +366 -0
- package/build/constants/countries.js +374 -0
- package/build/constants/index.d.ts +3 -0
- package/build/constants/index.js +3 -0
- package/build/context/Click2PayContext.d.ts +196 -0
- package/build/context/Click2PayContext.js +274 -0
- package/build/context/utils/chargeCall.d.ts +11 -0
- package/build/context/utils/chargeCall.js +82 -0
- package/build/features/CheckoutShell/CheckoutShell.css +76 -0
- package/build/features/CheckoutShell/CheckoutShell.d.ts +6 -0
- package/build/features/CheckoutShell/CheckoutShell.js +73 -0
- package/build/features/CheckoutShell/index.d.ts +1 -0
- package/build/features/CheckoutShell/index.js +1 -0
- package/build/features/Click2Pay/CardWeb/CardWeb.d.ts +7 -0
- package/build/features/Click2Pay/CardWeb/CardWeb.js +47 -0
- package/build/features/Click2Pay/CardWeb/index.d.ts +2 -0
- package/build/features/Click2Pay/CardWeb/index.js +2 -0
- package/build/features/Click2Pay/Click2PayBackButton/Click2PayBackButton.d.ts +8 -0
- package/build/features/Click2Pay/Click2PayBackButton/Click2PayBackButton.js +42 -0
- package/build/features/Click2Pay/Click2PayBackButton/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PayBackButton/index.js +1 -0
- package/build/features/Click2Pay/Click2PayCardAuthentication/hooks/useCheckoutWithCard.d.ts +7 -0
- package/build/features/Click2Pay/Click2PayCardAuthentication/hooks/useCheckoutWithCard.js +351 -0
- package/build/features/Click2Pay/Click2PayCardAuthentication/utils/index.d.ts +4 -0
- package/build/features/Click2Pay/Click2PayCardAuthentication/utils/index.js +18 -0
- package/build/features/Click2Pay/Click2PayCardButton/Click2PayCardButton.d.ts +13 -0
- package/build/features/Click2Pay/Click2PayCardButton/Click2PayCardButton.js +43 -0
- package/build/features/Click2Pay/Click2PayCardButton/index.d.ts +2 -0
- package/build/features/Click2Pay/Click2PayCardButton/index.js +2 -0
- package/build/features/Click2Pay/Click2PayChips/BackIcon.d.ts +2 -0
- package/build/features/Click2Pay/Click2PayChips/BackIcon.js +11 -0
- package/build/features/Click2Pay/Click2PayChips/Click2PayChips.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayChips/Click2PayChips.js +88 -0
- package/build/features/Click2Pay/Click2PayChips/index.d.ts +2 -0
- package/build/features/Click2Pay/Click2PayChips/index.js +2 -0
- package/build/features/Click2Pay/Click2PayChipsContainer/Click2PayChipsContainer.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayChipsContainer/Click2PayChipsContainer.js +16 -0
- package/build/features/Click2Pay/Click2PayChipsContainer/index.d.ts +2 -0
- package/build/features/Click2Pay/Click2PayChipsContainer/index.js +2 -0
- package/build/features/Click2Pay/Click2PaySignOutButton/Click2PaySignOutButton.d.ts +3 -0
- package/build/features/Click2Pay/Click2PaySignOutButton/Click2PaySignOutButton.js +24 -0
- package/build/features/Click2Pay/Click2PaySignOutButton/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PaySignOutButton/index.js +1 -0
- package/build/features/Click2Pay/Click2PaySupportedCardsList/Click2PaySupportedCardsList.d.ts +7 -0
- package/build/features/Click2Pay/Click2PaySupportedCardsList/Click2PaySupportedCardsList.js +53 -0
- package/build/features/Click2Pay/Click2PaySupportedCardsList/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PaySupportedCardsList/index.js +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltip.d.ts +9 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltip.js +23 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/Click2PayTooltipButton.d.ts +9 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/Click2PayTooltipButton.js +39 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/Click2PayTooltipButtonExclamation.d.ts +6 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/Click2PayTooltipButtonExclamation.js +24 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/index.d.ts +2 -0
- package/build/features/Click2Pay/Click2PayTooltip/Click2PayTooltipButtons/index.js +2 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/InformationUsageContent.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/InformationUsageContent.js +43 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/InformationUsageTooltip.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/InformationUsageTooltip.js +12 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/InformationUsageTooltip/index.js +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/LearnMoreContent.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/LearnMoreContent.js +68 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/LearnMoreTooltip.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/LearnMoreTooltip.js +12 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/LearnMoreTooltip/index.js +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/RememberMeContent.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/RememberMeContent.js +42 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/RememberMeTooltip.d.ts +3 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/RememberMeTooltip.js +13 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/index.d.ts +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/RememberMeTooltip/index.js +1 -0
- package/build/features/Click2Pay/Click2PayTooltip/index.d.ts +5 -0
- package/build/features/Click2Pay/Click2PayTooltip/index.js +5 -0
- package/build/features/Click2Pay/DefaultPayButton/DefaultPayButton.d.ts +16 -0
- package/build/features/Click2Pay/DefaultPayButton/DefaultPayButton.js +67 -0
- package/build/features/Click2Pay/DefaultPayButton/index.d.ts +3 -0
- package/build/features/Click2Pay/DefaultPayButton/index.js +2 -0
- package/build/features/Click2Pay/LockedView/LockedView.d.ts +3 -0
- package/build/features/Click2Pay/LockedView/LockedView.js +22 -0
- package/build/features/Click2Pay/LockedView/index.d.ts +1 -0
- package/build/features/Click2Pay/LockedView/index.js +1 -0
- package/build/features/Click2Pay/LoginForm/LoginForm.d.ts +7 -0
- package/build/features/Click2Pay/LoginForm/LoginForm.js +39 -0
- package/build/features/Click2Pay/LoginForm/components/Email.d.ts +6 -0
- package/build/features/Click2Pay/LoginForm/components/Email.js +91 -0
- package/build/features/Click2Pay/LoginForm/components/LoginFormFooter.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/components/LoginFormFooter.js +25 -0
- package/build/features/Click2Pay/LoginForm/components/MobileNumber.d.ts +6 -0
- package/build/features/Click2Pay/LoginForm/components/MobileNumber.js +103 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/ChangePaymentMethodButton/ChangePaymentMethodButton.d.ts +9 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/ChangePaymentMethodButton/ChangePaymentMethodButton.js +29 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/ChangePaymentMethodButton/index.d.ts +2 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/ChangePaymentMethodButton/index.js +2 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/HeaderMessage.d.ts +7 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/HeaderMessage.js +29 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/LoginFormOTP.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/LoginFormOTP.js +190 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/OTPActionButton/OTPActionButton.d.ts +10 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/OTPActionButton/OTPActionButton.js +24 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/OTPButton/OTPButton.d.ts +6 -0
- package/build/features/Click2Pay/LoginForm/components/OTP/OTPButton/OTPButton.js +23 -0
- package/build/features/Click2Pay/LoginForm/index.d.ts +2 -0
- package/build/features/Click2Pay/LoginForm/index.js +2 -0
- package/build/features/Click2Pay/LoginForm/useClick2PayLoginForm.d.ts +10 -0
- package/build/features/Click2Pay/LoginForm/useClick2PayLoginForm.js +233 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/getCards.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/getCards.js +8 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/idLookup.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/idLookup.js +8 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/init.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/init.js +8 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/initialValidationResponse.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/initialValidationResponse.js +8 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/validateOTP.d.ts +3 -0
- package/build/features/Click2Pay/LoginForm/utils/assert/validateOTP.js +9 -0
- package/build/features/Click2Pay/LoginForm/utils/index.d.ts +5 -0
- package/build/features/Click2Pay/LoginForm/utils/index.js +5 -0
- package/build/features/Click2Pay/PaymentButton/CardList/CardList.d.ts +7 -0
- package/build/features/Click2Pay/PaymentButton/CardList/CardList.js +55 -0
- package/build/features/Click2Pay/PaymentButton/CardList/CardList.module.css +13 -0
- package/build/features/Click2Pay/PaymentButton/Click2PayPaymentButton.d.ts +16 -0
- package/build/features/Click2Pay/PaymentButton/Click2PayPaymentButton.js +22 -0
- package/build/features/Click2Pay/PaymentButton/animation/animationFeatures.d.ts +2 -0
- package/build/features/Click2Pay/PaymentButton/animation/animationFeatures.js +2 -0
- package/build/features/Click2Pay/PaymentButton/useClick2PayPaymentButton.d.ts +15 -0
- package/build/features/Click2Pay/PaymentButton/useClick2PayPaymentButton.js +30 -0
- package/build/features/Click2Pay/WidgetHints/ExclamationMarkIcon.d.ts +2 -0
- package/build/features/Click2Pay/WidgetHints/ExclamationMarkIcon.js +5 -0
- package/build/features/Click2Pay/WidgetHints/PopupNotEnabledHint.d.ts +2 -0
- package/build/features/Click2Pay/WidgetHints/PopupNotEnabledHint.js +51 -0
- package/build/features/Click2Pay/WidgetHints/SeeHowArrow.d.ts +3 -0
- package/build/features/Click2Pay/WidgetHints/SeeHowArrow.js +6 -0
- package/build/features/Click2Pay/WidgetHints/WidgetHints.d.ts +5 -0
- package/build/features/Click2Pay/WidgetHints/WidgetHints.js +44 -0
- package/build/features/Click2Pay/WidgetHints/index.d.ts +1 -0
- package/build/features/Click2Pay/WidgetHints/index.js +1 -0
- package/build/features/Click2Pay/index.d.ts +1 -0
- package/build/features/Click2Pay/index.js +1 -0
- package/build/hooks/index.d.ts +6 -0
- package/build/hooks/index.js +6 -0
- package/build/hooks/useAppTheme.d.ts +12 -0
- package/build/hooks/useAppTheme.js +27 -0
- package/build/hooks/useCard.d.ts +23 -0
- package/build/hooks/useCard.js +136 -0
- package/build/hooks/useCardWeb.d.ts +12 -0
- package/build/hooks/useCardWeb.js +143 -0
- package/build/hooks/useClick2Pay.d.ts +42 -0
- package/build/hooks/useClick2Pay.js +244 -0
- package/build/hooks/useClickToPayStatus.d.ts +4 -0
- package/build/hooks/useClickToPayStatus.js +13 -0
- package/build/hooks/useGetEvents.d.ts +5 -0
- package/build/hooks/useGetEvents.js +16 -0
- package/build/hooks/usePreLoadScripts.d.ts +6 -0
- package/build/hooks/usePreLoadScripts.js +23 -0
- package/build/hooks/useResizeObserver.d.ts +3 -0
- package/build/hooks/useResizeObserver.js +19 -0
- package/build/hooks/useScript.d.ts +4 -0
- package/build/hooks/useScript.js +39 -0
- package/build/hooks/useTranslation.d.ts +7 -0
- package/build/hooks/useTranslation.js +5 -0
- package/build/hooks/utils/initialCall.d.ts +13 -0
- package/build/hooks/utils/initialCall.js +83 -0
- package/build/i18n.d.ts +11 -0
- package/build/i18n.js +26 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +11 -0
- package/build/theme/index.d.ts +1 -0
- package/build/theme/index.js +1 -0
- package/build/theme/palette.d.ts +3 -0
- package/build/theme/palette.js +75 -0
- package/build/theme/shadows.d.ts +2 -0
- package/build/theme/shadows.js +27 -0
- package/build/theme/theme.d.ts +3 -0
- package/build/theme/theme.js +45 -0
- package/build/theme/typography.d.ts +3 -0
- package/build/theme/typography.js +40 -0
- package/build/utils/baseConfigs.d.ts +11 -0
- package/build/utils/baseConfigs.js +64 -0
- package/build/utils/charge.d.ts +14 -0
- package/build/utils/charge.js +19 -0
- package/build/utils/click2Pay.d.ts +1 -0
- package/build/utils/click2Pay.js +7 -0
- package/build/utils/font.d.ts +1 -0
- package/build/utils/font.js +1 -0
- package/build/utils/form/email.d.ts +3 -0
- package/build/utils/form/email.js +4 -0
- package/build/utils/form/phone.d.ts +4 -0
- package/build/utils/form/phone.js +3 -0
- package/build/utils/index.d.ts +8 -0
- package/build/utils/index.js +8 -0
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +7 -0
- package/build/utils/paymentMethod.d.ts +2 -0
- package/build/utils/paymentMethod.js +3 -0
- package/build/utils/strings.d.ts +13 -0
- package/build/utils/strings.js +52 -0
- package/build/utils/window.d.ts +10 -0
- package/build/utils/window.js +36 -0
- package/package.json +121 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { useAppTheme } from '../../hooks';
|
|
5
|
+
import { getFontFormat, getProperty } from '../../utils';
|
|
6
|
+
import { useMask, format } from '@react-input/mask';
|
|
7
|
+
import { OTPFieldErrorType } from '../../@types';
|
|
8
|
+
const DIGIT_WIDTH = 50;
|
|
9
|
+
const MASK_SPACINGS = [...Array(10)].join(' ');
|
|
10
|
+
const InputWrapper = styled('div')({
|
|
11
|
+
'--input-width': `${DIGIT_WIDTH}px`,
|
|
12
|
+
height: 48,
|
|
13
|
+
overflow: 'hidden',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
borderRadius: 10,
|
|
16
|
+
});
|
|
17
|
+
const Input = styled('input')({
|
|
18
|
+
position: 'relative',
|
|
19
|
+
textAlign: 'center',
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
fontSize: 20,
|
|
23
|
+
border: 'none',
|
|
24
|
+
padding: 0,
|
|
25
|
+
':focus': {
|
|
26
|
+
outline: 'none',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const combineClasses = (...args) => args.filter(Boolean).join(' ');
|
|
30
|
+
const getCalcStyles = (appTheme, digits) => {
|
|
31
|
+
const TapOtpViewThemeObj = appTheme.TapOtpView;
|
|
32
|
+
const textColor = getProperty(TapOtpViewThemeObj.OtpController.textColor, appTheme.GlobalValues.Colors);
|
|
33
|
+
const backgroundColor = getProperty(TapOtpViewThemeObj.OtpController.backgroundColor, appTheme.GlobalValues.Colors);
|
|
34
|
+
const borderColor = getProperty(TapOtpViewThemeObj.OtpController.borderColor, appTheme.GlobalValues.Colors);
|
|
35
|
+
const activeBorderColor = getProperty(TapOtpViewThemeObj.OtpController.activeBorderColor, appTheme.GlobalValues.Colors);
|
|
36
|
+
const activeBackgroundColor = getProperty(TapOtpViewThemeObj.OtpController.backgroundColor, appTheme.GlobalValues.Colors);
|
|
37
|
+
const activeBackgroundColorError = 'rgba(234, 97, 28, 0.04)';
|
|
38
|
+
const font = getFontFormat(TapOtpViewThemeObj.OtpController.textFont);
|
|
39
|
+
const width = `calc(var(--input-width) * ${digits})`;
|
|
40
|
+
return {
|
|
41
|
+
inputWrapper: {
|
|
42
|
+
border: `1px solid ${borderColor}`,
|
|
43
|
+
width,
|
|
44
|
+
backgroundColor,
|
|
45
|
+
'&.focus': {
|
|
46
|
+
border: `1px solid ${activeBorderColor}`,
|
|
47
|
+
},
|
|
48
|
+
transition: 'all 0.3s ease !important',
|
|
49
|
+
'&.error': {
|
|
50
|
+
backgroundColor: activeBackgroundColorError,
|
|
51
|
+
border: '1px solid #EA611C',
|
|
52
|
+
'&.focus': {
|
|
53
|
+
border: '1px solid #EA611C',
|
|
54
|
+
backgroundColor: activeBackgroundColorError,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
input: {
|
|
59
|
+
transition: 'all 0.3s ease !important',
|
|
60
|
+
color: textColor,
|
|
61
|
+
backgroundColor: 'transparent',
|
|
62
|
+
font,
|
|
63
|
+
'&:focus': {
|
|
64
|
+
backgroundColor: activeBackgroundColor,
|
|
65
|
+
},
|
|
66
|
+
'&.error': {
|
|
67
|
+
backgroundColor: activeBackgroundColorError,
|
|
68
|
+
'&.focus': {
|
|
69
|
+
backgroundColor: activeBackgroundColorError,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const OTPInput = (props) => {
|
|
76
|
+
const { value: rawValue, onChange, maxLengthDigits, minLengthDigits, error, errorType, shouldAutoFocus } = props;
|
|
77
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
78
|
+
const { theme: appTheme } = useAppTheme();
|
|
79
|
+
const placeholderMask = useMemo(() => [...Array(minLengthDigits)].map(() => '-').join(MASK_SPACINGS), [minLengthDigits]);
|
|
80
|
+
const mask = useMemo(() => [...Array(maxLengthDigits)].map(() => '_').join(MASK_SPACINGS), [maxLengthDigits]);
|
|
81
|
+
const maskOptions = useMemo(() => ({
|
|
82
|
+
mask,
|
|
83
|
+
replacement: { _: /\d/ },
|
|
84
|
+
}), [mask]);
|
|
85
|
+
const inputRef = useMask(maskOptions);
|
|
86
|
+
const value = useMemo(() => format(rawValue || '', maskOptions), [rawValue, maskOptions]);
|
|
87
|
+
const inputWrapperClasses = useMemo(() => combineClasses(isFocused && 'focus', error && 'error', errorType === OTPFieldErrorType.INVALID && 'error-invalid', errorType === OTPFieldErrorType.LOCKED && 'error-locked'), [isFocused, error, errorType]);
|
|
88
|
+
const inputClasses = useMemo(() => combineClasses(error && 'error', errorType === OTPFieldErrorType.INVALID && 'error-invalid', errorType === OTPFieldErrorType.LOCKED && 'error-locked'), [error, errorType]);
|
|
89
|
+
const calcStyles = useMemo(() => getCalcStyles(appTheme, maxLengthDigits), [maxLengthDigits, appTheme]);
|
|
90
|
+
const handleChange = event => {
|
|
91
|
+
const { value: newVal } = event.target;
|
|
92
|
+
const formattedValue = newVal.replace(new RegExp(MASK_SPACINGS, 'g'), '');
|
|
93
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(formattedValue, event);
|
|
94
|
+
};
|
|
95
|
+
return (_jsx(InputWrapper, { "data-testid": "otp-input-wrapper", className: inputWrapperClasses, sx: calcStyles.inputWrapper, children: _jsx(Input, { "data-selector": "OTPInput", className: inputClasses, autoFocus: shouldAutoFocus, ref: inputRef, sx: calcStyles.input, disabled: error && errorType === OTPFieldErrorType.LOCKED, "data-testid": "otp-input-field", value: value, onChange: handleChange, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), placeholder: isFocused ? '' : placeholderMask }) }));
|
|
96
|
+
};
|
|
97
|
+
export default OTPInput;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type OTPInputProps } from 'react-otp-input';
|
|
3
|
+
export declare enum OTPFieldErrorType {
|
|
4
|
+
INVALID = "invalid",
|
|
5
|
+
LOCKED = "locked"
|
|
6
|
+
}
|
|
7
|
+
interface OTPInputAdapterProps extends Omit<OTPInputProps, 'renderInput'> {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
errorType?: OTPFieldErrorType | null;
|
|
11
|
+
type?: React.HTMLInputTypeAttribute;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: React.NamedExoticComponent<OTPInputAdapterProps>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React, { useMemo, useRef } from 'react';
|
|
14
|
+
import Box from '@mui/material/Box';
|
|
15
|
+
import Stack from '@mui/material/Stack';
|
|
16
|
+
import OtpInput from 'react-otp-input';
|
|
17
|
+
import { useAppTheme } from '../../hooks/useAppTheme';
|
|
18
|
+
import { getFontFormat, getProperty } from '../../utils';
|
|
19
|
+
export var OTPFieldErrorType;
|
|
20
|
+
(function (OTPFieldErrorType) {
|
|
21
|
+
OTPFieldErrorType["INVALID"] = "invalid";
|
|
22
|
+
OTPFieldErrorType["LOCKED"] = "locked";
|
|
23
|
+
})(OTPFieldErrorType || (OTPFieldErrorType = {}));
|
|
24
|
+
const styles = {
|
|
25
|
+
getInputField: (overrideTheme) => {
|
|
26
|
+
const { borderColor, backgroundColor, textColor, font, activeBorderColor, activeBackgroundColor, activeBorderColorError, activeBackgroundColorError, } = overrideTheme;
|
|
27
|
+
return {
|
|
28
|
+
pointerEvents: 'auto',
|
|
29
|
+
outline: 'none !important',
|
|
30
|
+
boxSizing: 'border-box !important',
|
|
31
|
+
padding: '0 !important',
|
|
32
|
+
margin: '0 !important',
|
|
33
|
+
display: 'flex !important',
|
|
34
|
+
justifyContent: 'center !important',
|
|
35
|
+
alignItems: 'center !important',
|
|
36
|
+
width: '45.167px !important',
|
|
37
|
+
height: '48px !important',
|
|
38
|
+
borderRadius: '8px !important',
|
|
39
|
+
border: `1px solid ${borderColor}`,
|
|
40
|
+
color: textColor,
|
|
41
|
+
background: backgroundColor,
|
|
42
|
+
font,
|
|
43
|
+
transition: 'all 0.3s ease !important',
|
|
44
|
+
'&:nth-of-type(3)': {
|
|
45
|
+
marginInlineEnd: '16px !important',
|
|
46
|
+
},
|
|
47
|
+
'&:focus-visible': {
|
|
48
|
+
outline: 'none !important',
|
|
49
|
+
borderRadius: '8px !important',
|
|
50
|
+
border: `1px solid ${activeBorderColor}`,
|
|
51
|
+
background: activeBackgroundColor,
|
|
52
|
+
boxShadow: '0px 0px 8px 0px rgba(0, 0, 0, 0.15)',
|
|
53
|
+
},
|
|
54
|
+
'&.error': {
|
|
55
|
+
pointerEvents: 'auto',
|
|
56
|
+
color: textColor,
|
|
57
|
+
background: backgroundColor,
|
|
58
|
+
'&.error-invalid': {
|
|
59
|
+
'&.first-field': {
|
|
60
|
+
border: '1px solid #EA611C',
|
|
61
|
+
background: activeBackgroundColorError,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
'&.error-locked': {
|
|
65
|
+
pointerEvents: 'none !important',
|
|
66
|
+
border: '1px solid transparent',
|
|
67
|
+
color: activeBorderColorError,
|
|
68
|
+
background: activeBackgroundColorError,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const OTPInputAdapter = (_a) => {
|
|
75
|
+
var { open, error, errorType, type = 'number' } = _a, props = __rest(_a, ["open", "error", "errorType", "type"]);
|
|
76
|
+
const { theme: appTheme } = useAppTheme();
|
|
77
|
+
const inputWrappersRef = useRef([]);
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
if (!error)
|
|
80
|
+
return;
|
|
81
|
+
const inputWrappers = inputWrappersRef.current;
|
|
82
|
+
let timer = null;
|
|
83
|
+
if (errorType === OTPFieldErrorType.INVALID) {
|
|
84
|
+
timer = setTimeout(() => {
|
|
85
|
+
var _a;
|
|
86
|
+
const inputWrapper = inputWrappers[0];
|
|
87
|
+
(_a = inputWrapper === null || inputWrapper === void 0 ? void 0 : inputWrapper.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
88
|
+
}, 10);
|
|
89
|
+
}
|
|
90
|
+
return () => clearTimeout(timer);
|
|
91
|
+
}, [error, errorType]);
|
|
92
|
+
const TapOtpViewThemeObj = appTheme.TapOtpView;
|
|
93
|
+
const textColor = getProperty(TapOtpViewThemeObj.OtpController.textColor, appTheme.GlobalValues.Colors);
|
|
94
|
+
const backgroundColor = getProperty(TapOtpViewThemeObj.OtpController.backgroundColor, appTheme.GlobalValues.Colors);
|
|
95
|
+
const borderColor = getProperty(TapOtpViewThemeObj.OtpController.borderColor, appTheme.GlobalValues.Colors);
|
|
96
|
+
const activeBorderColor = getProperty(TapOtpViewThemeObj.OtpController.activeBorderColor, appTheme.GlobalValues.Colors);
|
|
97
|
+
const activeBackgroundColor = getProperty(TapOtpViewThemeObj.OtpController.backgroundColor, appTheme.GlobalValues.Colors);
|
|
98
|
+
const activeBackgroundColorError = 'rgba(234, 97, 28, 0.04)';
|
|
99
|
+
const activeBorderColorError = getProperty(TapOtpViewThemeObj.Invalid.Message.textColor, appTheme.GlobalValues.Colors);
|
|
100
|
+
const inputStyles = useMemo(() => styles.getInputField({
|
|
101
|
+
font: getFontFormat(TapOtpViewThemeObj.OtpController.textFont),
|
|
102
|
+
borderColor,
|
|
103
|
+
textColor,
|
|
104
|
+
backgroundColor,
|
|
105
|
+
activeBorderColor,
|
|
106
|
+
activeBackgroundColor,
|
|
107
|
+
activeBorderColorError,
|
|
108
|
+
activeBackgroundColorError,
|
|
109
|
+
}), [
|
|
110
|
+
TapOtpViewThemeObj.OtpController.textFont,
|
|
111
|
+
borderColor,
|
|
112
|
+
textColor,
|
|
113
|
+
backgroundColor,
|
|
114
|
+
activeBorderColor,
|
|
115
|
+
activeBackgroundColor,
|
|
116
|
+
activeBorderColorError,
|
|
117
|
+
activeBackgroundColorError,
|
|
118
|
+
]);
|
|
119
|
+
const errorClassNames = useMemo(() => {
|
|
120
|
+
const result = [];
|
|
121
|
+
if (!error)
|
|
122
|
+
return '';
|
|
123
|
+
result.push('error');
|
|
124
|
+
if (errorType === OTPFieldErrorType.INVALID) {
|
|
125
|
+
result.push('error-invalid');
|
|
126
|
+
}
|
|
127
|
+
else if (errorType === OTPFieldErrorType.LOCKED) {
|
|
128
|
+
result.push('error-locked');
|
|
129
|
+
}
|
|
130
|
+
return result.join(' ');
|
|
131
|
+
}, [error, errorType]);
|
|
132
|
+
if (!open)
|
|
133
|
+
return null;
|
|
134
|
+
return (_jsx(OtpInput, Object.assign({ "data-selector": "OTPInput", "data-testid": "OTPInputAdapter", shouldAutoFocus: true }, props, { containerStyle: {
|
|
135
|
+
display: 'flex',
|
|
136
|
+
width: '100%',
|
|
137
|
+
justifyContent: 'space-between',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
gap: '8px',
|
|
140
|
+
direction: 'ltr',
|
|
141
|
+
}, renderInput: (inputProps, index) => (_jsx(Stack, { justifyContent: "center", alignItems: "center", "data-testid": `otp-input-wrapper-${index}`, ref: ref => {
|
|
142
|
+
inputWrappersRef.current[index] = ref;
|
|
143
|
+
}, children: _jsx(Box, Object.assign({ component: "input" }, inputProps, { type: type, inputMode: "numeric", sx: inputStyles, disabled: error && errorType === OTPFieldErrorType.LOCKED, className: `${errorClassNames} ${index === 0 ? 'first-field' : ''}` })) })) })));
|
|
144
|
+
};
|
|
145
|
+
OTPInputAdapter.displayName = 'OTPInputAdapter';
|
|
146
|
+
export default React.memo(OTPInputAdapter);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OTPTimerProps {
|
|
3
|
+
time?: number;
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
onResend: () => void;
|
|
6
|
+
labelStyle?: React.CSSProperties;
|
|
7
|
+
timerStyle?: React.CSSProperties;
|
|
8
|
+
resendButtonStyle?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: React.NamedExoticComponent<Readonly<OTPTimerProps>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import Text from '../Text';
|
|
7
|
+
import { DirectionMode } from '../../@types';
|
|
8
|
+
import { getFontFormat, getProperty, StringUtils } from '../../utils';
|
|
9
|
+
import { useAppTheme } from '../../hooks';
|
|
10
|
+
import { useTimer } from './hooks/useTimer';
|
|
11
|
+
const ResendTextButton = styled('button')(() => ({
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
appearance: 'none',
|
|
14
|
+
border: 'none',
|
|
15
|
+
backgroundColor: 'transparent',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
height: '28.5px',
|
|
18
|
+
padding: '12px',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
gap: '9.5px',
|
|
22
|
+
borderRadius: '66.5px',
|
|
23
|
+
background: 'rgba(31, 136, 208, 0.10)',
|
|
24
|
+
color: '#1F88D0',
|
|
25
|
+
fontFamily: 'Lato',
|
|
26
|
+
fontSize: '15px',
|
|
27
|
+
fontStyle: 'normal',
|
|
28
|
+
fontWeight: 400,
|
|
29
|
+
lineHeight: '100%',
|
|
30
|
+
}));
|
|
31
|
+
const TimerBox = styled(Box)(() => ({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
gap: '7.6px',
|
|
35
|
+
}));
|
|
36
|
+
const TimerValueText = styled(Text)(() => ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
minWidth: '55px',
|
|
39
|
+
height: '28.5px',
|
|
40
|
+
padding: '9.5px',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
gap: '9.5px',
|
|
44
|
+
borderRadius: '66.5px',
|
|
45
|
+
letterSpacing: '-0.093px',
|
|
46
|
+
}));
|
|
47
|
+
const OTPTimer = ({ time, isVisible, onResend, labelStyle, timerStyle, resendButtonStyle, }) => {
|
|
48
|
+
const { t } = useTranslation();
|
|
49
|
+
const { theme: appTheme } = useAppTheme();
|
|
50
|
+
const { seconds } = useTimer({
|
|
51
|
+
time,
|
|
52
|
+
isVisible,
|
|
53
|
+
});
|
|
54
|
+
const formattedSeconds = `${StringUtils.padStartZero(Math.floor(seconds / 60), 2)}:${StringUtils.padStartZero(seconds % 60, 2)}`;
|
|
55
|
+
return (_jsx(_Fragment, { children: seconds > 0 ? (_jsxs(TimerBox, { children: [_jsx(Text, { sx: Object.assign({ color: getProperty(appTheme.TapOtpView.Resend.labelColor, appTheme.GlobalValues.Colors) }, labelStyle), children: t('Click2Pay.otp.resendLabel') }), _jsx(TimerValueText, { "data-testid": "OTPTimer", dir: DirectionMode.LTR, sx: Object.assign({ font: getFontFormat(appTheme.TapOtpView.Timer.textFont), color: getProperty(appTheme.TapOtpView.Timer.textColor, appTheme.GlobalValues.Colors), background: getProperty(appTheme.TapOtpView.Timer.backgroundColor, appTheme.GlobalValues.Colors) }, timerStyle), children: seconds > 0 && formattedSeconds })] })) : (_jsx(ResendTextButton, { type: "button", "data-testid": "OTPTimer_Resend_Label", onClick: onResend, sx: Object.assign({ font: getFontFormat(appTheme.TapOtpView.Resend.font), color: getProperty(appTheme.TapOtpView.Resend.color, appTheme.GlobalValues.Colors), background: getProperty(appTheme.TapOtpView.Resend.backgroundColor, appTheme.GlobalValues.Colors) }, resendButtonStyle), children: t('ActionButton.resend') })) }));
|
|
56
|
+
};
|
|
57
|
+
OTPTimer.displayName = 'OTPTimer';
|
|
58
|
+
export default React.memo(OTPTimer);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function useTimer({ time = 60, isVisible }) {
|
|
3
|
+
const [seconds, setSeconds] = React.useState(time);
|
|
4
|
+
React.useEffect(() => {
|
|
5
|
+
if (!isVisible)
|
|
6
|
+
return;
|
|
7
|
+
setSeconds(time);
|
|
8
|
+
const interval = setInterval(() => {
|
|
9
|
+
setSeconds(prevSeconds => {
|
|
10
|
+
if (prevSeconds > 0) {
|
|
11
|
+
return prevSeconds - 1;
|
|
12
|
+
}
|
|
13
|
+
if (interval) {
|
|
14
|
+
clearInterval(interval);
|
|
15
|
+
}
|
|
16
|
+
return 0;
|
|
17
|
+
});
|
|
18
|
+
}, 1000);
|
|
19
|
+
return () => {
|
|
20
|
+
if (interval) {
|
|
21
|
+
clearInterval(interval);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}, [isVisible, time]);
|
|
25
|
+
return {
|
|
26
|
+
seconds,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OTPTimer } from './OTPTimer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OTPTimer } from './OTPTimer';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { PhoneInput as PhoneInputBase } from '@tap-payments/acceptance-sdk';
|
|
3
|
+
type PI = ComponentPropsWithoutRef<typeof PhoneInputBase>;
|
|
4
|
+
interface PhoneInputProps extends Omit<PI, 'color'> {
|
|
5
|
+
color?: React.CSSProperties['color'];
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.NamedExoticComponent<Readonly<PhoneInputProps>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { PhoneInput as PhoneInputBase } from '@tap-payments/acceptance-sdk';
|
|
15
|
+
import { getFontFormat, getProperty } from '../../utils';
|
|
16
|
+
import { useAppTheme } from '../../hooks';
|
|
17
|
+
const PhoneInput = (_a) => {
|
|
18
|
+
var _b, _c, _d;
|
|
19
|
+
var { color } = _a, props = __rest(_a, ["color"]);
|
|
20
|
+
const { theme: appTheme, dir } = useAppTheme();
|
|
21
|
+
const inputBgColor = getProperty(appTheme.customerDataCollection.backgroundColor, appTheme.GlobalValues.Colors);
|
|
22
|
+
const inputTextColor = color !== null && color !== void 0 ? color : getProperty((_d = (_c = (_b = appTheme.customerDataCollection) === null || _b === void 0 ? void 0 : _b.textfields) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : 'greyishBrown', appTheme.GlobalValues.Colors);
|
|
23
|
+
const handleKeyDown = (event) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const allowedKeys = [
|
|
26
|
+
'Backspace',
|
|
27
|
+
'Delete',
|
|
28
|
+
'Tab',
|
|
29
|
+
'Escape',
|
|
30
|
+
'Enter',
|
|
31
|
+
'ArrowUp',
|
|
32
|
+
'ArrowDown',
|
|
33
|
+
'ArrowLeft',
|
|
34
|
+
'ArrowRight',
|
|
35
|
+
'Home',
|
|
36
|
+
'End',
|
|
37
|
+
];
|
|
38
|
+
if (allowedKeys.includes(event.key))
|
|
39
|
+
return;
|
|
40
|
+
if ((event.ctrlKey || event.metaKey) && ['v', 'x', 'a'].includes(event.key))
|
|
41
|
+
return;
|
|
42
|
+
const { selectionStart, selectionEnd } = event.target;
|
|
43
|
+
const isNotNumber = Number.isNaN(Number(event.key));
|
|
44
|
+
const isReplacingSelection = selectionStart !== selectionEnd;
|
|
45
|
+
if (isNotNumber && !isReplacingSelection) {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
}
|
|
48
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
49
|
+
};
|
|
50
|
+
return (_jsx(PhoneInputBase, Object.assign({}, props, { onKeyDown: handleKeyDown, type: "number", inputMode: "tel", variant: "standard", fullWidth: true, inputProps: { inputMode: 'tel', autoComplete: 'tel-national' }, InputProps: { disableUnderline: true }, sx: Object.assign(Object.assign({ background: inputBgColor, '& input': {
|
|
51
|
+
color: inputTextColor,
|
|
52
|
+
}, 'input.MuiInputBase-input': {
|
|
53
|
+
direction: `${dir} !important`,
|
|
54
|
+
font: getFontFormat(appTheme.customerDataCollection.textfields.countryCodeLabelFont),
|
|
55
|
+
color: inputTextColor,
|
|
56
|
+
}, '& input:-webkit-autofill': {
|
|
57
|
+
WebkitBoxShadow: `0 0 0 30px ${inputBgColor} inset !important`,
|
|
58
|
+
WebkitTextFillColor: `${inputTextColor} !important`,
|
|
59
|
+
}, '& input:-webkit-autofill:hover': {
|
|
60
|
+
WebkitBoxShadow: `0 0 0 30px ${inputBgColor} inset !important`,
|
|
61
|
+
WebkitTextFillColor: `${inputTextColor} !important`,
|
|
62
|
+
}, '& input:-webkit-autofill:focus': {
|
|
63
|
+
WebkitBoxShadow: `0 0 0 30px ${inputBgColor} inset !important`,
|
|
64
|
+
WebkitTextFillColor: `${inputTextColor} !important`,
|
|
65
|
+
}, '& input:-webkit-autofill:active': {
|
|
66
|
+
WebkitBoxShadow: `0 0 0 30px ${inputBgColor} inset !important`,
|
|
67
|
+
WebkitTextFillColor: `${inputTextColor} !important`,
|
|
68
|
+
} }, props.style), props.sx) })));
|
|
69
|
+
};
|
|
70
|
+
PhoneInput.displayName = 'PhoneInput';
|
|
71
|
+
export default React.memo(PhoneInput);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const SkeletonLoader = ({ isDarkMode = false }) => {
|
|
3
|
+
const colors = isDarkMode
|
|
4
|
+
? { bg: "#121212", base: "#2a2a2a", shimmer: "#3a3a3a" }
|
|
5
|
+
: { bg: "#f9f9f9", base: "#eeeeee", shimmer: "#f5f5f5" };
|
|
6
|
+
const skeletonStyles = `
|
|
7
|
+
@keyframes shimmer {
|
|
8
|
+
0% { background-position: -200% 0; }
|
|
9
|
+
100% { background-position: 200% 0; }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sk-wrapper {
|
|
13
|
+
width: 100%;
|
|
14
|
+
max-width: 500px;
|
|
15
|
+
padding: 24px;
|
|
16
|
+
background-color: ${colors.bg};
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
margin: 0 auto;
|
|
19
|
+
transition: background-color 0.3s ease;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sk-base {
|
|
23
|
+
background: ${colors.base};
|
|
24
|
+
background: linear-gradient(90deg, ${colors.base} 25%, ${colors.shimmer} 50%, ${colors.base} 75%);
|
|
25
|
+
background-size: 200% 100%;
|
|
26
|
+
animation: shimmer 1.5s infinite linear;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sk-label {
|
|
31
|
+
height: 12px;
|
|
32
|
+
margin-bottom: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sk-input {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 65px;
|
|
38
|
+
margin-bottom: 35px;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sk-button {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 55px;
|
|
45
|
+
border-radius: 4px; /* Matches the updated button style */
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
return (_jsxs("div", { className: "sk-wrapper", children: [_jsx("style", { children: skeletonStyles }), _jsx("div", { className: "sk-base sk-label", style: { width: "110px" } }), _jsx("div", { className: "sk-base sk-input" }), _jsx("div", { className: "sk-base sk-button" })] }));
|
|
49
|
+
};
|
|
50
|
+
export default SkeletonLoader;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import Typography from '@mui/material/Typography';
|
|
14
|
+
export default function Text(_a) {
|
|
15
|
+
var { children, variant } = _a, props = __rest(_a, ["children", "variant"]);
|
|
16
|
+
return (_jsx(Typography, Object.assign({ id: "text", "aria-label": "text", variant: variant || 'subtitle1', fontWeight: "normal" }, props, { children: children || '' })));
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
3
|
+
interface TooltipAdapterProps extends TooltipProps {
|
|
4
|
+
handleClose?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.NamedExoticComponent<Readonly<TooltipAdapterProps>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React, { memo } from 'react';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import Tooltip, { tooltipClasses } from '@mui/material/Tooltip';
|
|
16
|
+
import { ClickAwayListener } from '@mui/base/ClickAwayListener';
|
|
17
|
+
import { useAppTheme } from '../../hooks';
|
|
18
|
+
import { getProperty } from '../../utils';
|
|
19
|
+
import Box from '@mui/material/Box';
|
|
20
|
+
const HtmlTooltip = styled((_a) => {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx(Tooltip, Object.assign({}, props, { classes: { popper: className } })));
|
|
23
|
+
})(({ theme }) => ({
|
|
24
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
25
|
+
padding: '10.667px',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
alignItems: 'flex-start',
|
|
28
|
+
gap: '5.333px',
|
|
29
|
+
border: '1px solid #dadde9',
|
|
30
|
+
},
|
|
31
|
+
[`& .${tooltipClasses.arrow}`]: {
|
|
32
|
+
[`&::before`]: {
|
|
33
|
+
border: '1px solid #dadde9',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
const TooltipAdapter = (_a) => {
|
|
38
|
+
var { handleClose } = _a, props = __rest(_a, ["handleClose"]);
|
|
39
|
+
const { theme: appTheme } = useAppTheme();
|
|
40
|
+
const tooltipBaseThemePath = appTheme.Click2Pay.toolTip;
|
|
41
|
+
const handleClickAway = React.useCallback(() => {
|
|
42
|
+
handleClose === null || handleClose === void 0 ? void 0 : handleClose();
|
|
43
|
+
}, []);
|
|
44
|
+
return (_jsx(ClickAwayListener, { onClickAway: handleClickAway, children: _jsx(Box, { component: "section", "data-testid": "TooltipAdapter_ClickAwayListenerContainer", "data-open": props.open, sx: {
|
|
45
|
+
position: 'relative',
|
|
46
|
+
}, children: _jsx(HtmlTooltip, Object.assign({ "data-testid": "TooltipAdapter", arrow: true, placement: "top" }, props, { sx: {
|
|
47
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
48
|
+
marginBottom: '4px !important',
|
|
49
|
+
maxWidth: `${tooltipBaseThemePath.maxWidth}px`,
|
|
50
|
+
borderRadius: `${tooltipBaseThemePath.cornerRadius}px`,
|
|
51
|
+
backgroundColor: getProperty(tooltipBaseThemePath.background, appTheme.GlobalValues.Colors),
|
|
52
|
+
borderColor: getProperty(tooltipBaseThemePath.borderColor, appTheme.GlobalValues.Colors),
|
|
53
|
+
},
|
|
54
|
+
[`& .${tooltipClasses.arrow}`]: {
|
|
55
|
+
color: getProperty(tooltipBaseThemePath.background, appTheme.GlobalValues.Colors),
|
|
56
|
+
'::before': {
|
|
57
|
+
borderColor: getProperty(tooltipBaseThemePath.borderColor, appTheme.GlobalValues.Colors),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}, children: props.children })) }) }));
|
|
61
|
+
};
|
|
62
|
+
TooltipAdapter.displayName = 'TooltipAdapter';
|
|
63
|
+
export default memo(TooltipAdapter);
|