@opexa/portal-components 0.0.966 → 0.0.968

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.
Files changed (105) hide show
  1. package/dist/client/hooks/useCamera.js +28 -62
  2. package/dist/components/AccountInfo/AccountInfo.js +1 -1
  3. package/dist/components/AccountSecurity/AccountSecurity.js +1 -1
  4. package/dist/components/Banner/Banner.js +3 -3
  5. package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +1 -1
  6. package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +1 -1
  7. package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +1 -1
  8. package/dist/components/DepositWithdrawal/Deposit/AurixPayGCashDeposit/AurixPayGCashDeposit.js +2 -2
  9. package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +2 -2
  10. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js +2 -2
  11. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/Form.js +1 -1
  12. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +22 -11
  13. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
  14. package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit/GCashWebpayDeposit.js +1 -1
  15. package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +1 -1
  16. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
  17. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
  18. package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.js +1 -1
  19. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  20. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
  21. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  22. package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +1 -1
  23. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/Form.js +1 -1
  24. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +1 -0
  25. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -1
  26. package/dist/components/DepositWithdrawal/Withdrawal/GCashStandardCashInWithdrawal/GCashStandardCashInWithdrawal.js +2 -2
  27. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +2 -2
  28. package/dist/components/DepositWithdrawal/Withdrawal/InstapayGCashWithdrawal/InstapayGcashWithdrawal.js +3 -3
  29. package/dist/components/DepositWithdrawal/Withdrawal/InstapayPaymayaWithdrawal/InstapayPaymayaWithdrawal.js +3 -3
  30. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
  31. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +1 -1
  32. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +2 -2
  33. package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +1 -1
  34. package/dist/components/DepositWithdrawal/Withdrawal/TransactionPasswordNotSet.js +2 -2
  35. package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +5 -5
  36. package/dist/components/Disclaimer/DisclaimerV1.js +3 -3
  37. package/dist/components/Disclaimer/DisclaimerV2.js +3 -3
  38. package/dist/components/Disclaimer/DisclaimerV3.js +24 -15
  39. package/dist/components/ForgotPassword/Crazywin/CWForgotPassword.js +1 -1
  40. package/dist/components/ForgotPassword/Crazywin/CWForgotPasswordForm.js +2 -2
  41. package/dist/components/ForgotPassword/ForgotPasswordForm.js +3 -3
  42. package/dist/components/GameProviders/GameProvidersCarousel.d.ts +8 -0
  43. package/dist/components/GameProviders/GameProvidersCarousel.js +32 -0
  44. package/dist/components/Games/Game.js +2 -1
  45. package/dist/components/GamesSearch/GamesSearch.js +8 -5
  46. package/dist/components/Jackpots/JackpotsCarouselNext/JackpotsCarouselStageItem.js +1 -1
  47. package/dist/components/Quests/Crazywin/components/Countdown.js +1 -1
  48. package/dist/components/Search/Search.lazy.js +8 -5
  49. package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +0 -1
  50. package/dist/components/TermsOfUse/TermsOfUseV2.lazy.d.ts +1 -1
  51. package/dist/components/TermsOfUse/TermsOfUseV2.lazy.js +1 -1
  52. package/dist/components/TermsOfUse/TermsOfUseV3.lazy.d.ts +1 -1
  53. package/dist/components/TermsOfUse/TermsOfUseV3.lazy.js +1 -1
  54. package/dist/components/shared/SelfieImageField/useSelfieImageField.js +104 -59
  55. package/dist/handlers/index.d.ts +2 -2
  56. package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
  57. package/dist/services/auth.d.ts +2 -2
  58. package/dist/services/httpRequest.d.ts +2 -2
  59. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  60. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  61. package/dist/ui/Badge/Badge.d.ts +12 -12
  62. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  63. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  64. package/dist/ui/Carousel/Carousel.d.ts +153 -99
  65. package/dist/ui/Carousel/carousel.recipe.d.ts +17 -11
  66. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  67. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  68. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  69. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  70. package/dist/ui/Combobox/Combobox.d.ts +43 -43
  71. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  72. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  73. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  74. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  75. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  76. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  77. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  78. package/dist/ui/Field/Field.d.ts +21 -21
  79. package/dist/ui/Field/field.recipe.d.ts +3 -3
  80. package/dist/ui/Menu/Menu.d.ts +252 -252
  81. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  82. package/dist/ui/Popover/Popover.d.ts +88 -88
  83. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  84. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  85. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  86. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  87. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  88. package/dist/ui/Select/Select.d.ts +46 -46
  89. package/dist/ui/Select/select.recipe.d.ts +3 -3
  90. package/dist/ui/Table/Table.d.ts +21 -21
  91. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  92. package/dist/ui/Table/table.recipe.d.ts +3 -3
  93. package/package.json +1 -1
  94. package/dist/client/hooks/useVerifyMobileNumber.d.ts +0 -3
  95. package/dist/client/hooks/useVerifyMobileNumber.js +0 -20
  96. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts +0 -1
  97. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +0 -241
  98. package/dist/components/SingleSignOn/SingleSignOn.d.ts +0 -4
  99. package/dist/components/SingleSignOn/SingleSignOn.js +0 -185
  100. package/dist/components/SingleSignOn/index.d.ts +0 -1
  101. package/dist/components/SingleSignOn/index.js +0 -1
  102. /package/dist/{lib/components → components}/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.d.ts +0 -0
  103. /package/dist/{lib/components → components}/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.js +0 -0
  104. /package/dist/{lib/components → components}/UpdateMobilePhoneNumber/index.d.ts +0 -0
  105. /package/dist/{lib/components → components}/UpdateMobilePhoneNumber/index.js +0 -0
@@ -1,185 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { zodResolver } from '@hookform/resolvers/zod';
4
- import Image from 'next/image';
5
- import { useParams, useRouter, useSearchParams } from 'next/navigation';
6
- import { useEffect, useRef, useState } from 'react';
7
- import { Controller, useForm } from 'react-hook-form';
8
- import z from 'zod';
9
- import { useCooldown } from '../../client/hooks/useCooldown.js';
10
- import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
11
- import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
12
- import { useSendVerificationCodeMutation } from '../../client/hooks/useSendVerificationCodeMutation.js';
13
- import { useSignInSSOMutation } from '../../client/hooks/useSignInSSOMutation.js';
14
- import { useVerifyMobileNumber } from '../../client/hooks/useVerifyMobileNumber.js';
15
- import { toaster } from '../../client/utils/toaster.js';
16
- import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
17
- import cinePopLogo from '../../images/cinepop-logo.png';
18
- import dearUtolLogo from '../../images/dear-utol-logo.png';
19
- import inplayLogo from '../../images/inplay-logo.png';
20
- import lightBg from '../../images/light-bg.png';
21
- import mariasDiary from '../../images/marias-diary-logo.png';
22
- import secretConfessionsLogo from '../../images/secret-confessions-logo.png';
23
- import { Button } from '../../ui/Button/index.js';
24
- import { Dialog } from '../../ui/Dialog/index.js';
25
- import { Field } from '../../ui/Field/index.js';
26
- import { PinInput } from '../../ui/PinInput/index.js';
27
- import { Portal } from '../../ui/Portal/index.js';
28
- export function SingleSignOn() {
29
- const params = useParams();
30
- const searchParams = useSearchParams();
31
- const router = useRouter();
32
- const partnerId = params.partnerId;
33
- const token = searchParams.get('token');
34
- const [isSsoOpen, setIsSsoOpen] = useState(true);
35
- const [showVerifyDialog, setShowVerifyDialog] = useState(false);
36
- const ssoMutation = useSignInSSOMutation({
37
- onSuccess: () => {
38
- toaster.success({
39
- description: 'Account created successfully',
40
- });
41
- setIsSsoOpen(false);
42
- setShowVerifyDialog(true);
43
- },
44
- onError: () => {
45
- toaster.error({
46
- description: 'Account creation failed',
47
- });
48
- setIsSsoOpen(false);
49
- router.push('/');
50
- },
51
- });
52
- // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to trigger the mutation when the URL parameters change.
53
- useEffect(() => {
54
- // Trigger SSO login when component mounts
55
- if (partnerId && token && !ssoMutation.isPending) {
56
- ssoMutation.mutate({ partnerId, token });
57
- }
58
- }, [partnerId, token]);
59
- if (ssoMutation.isPending) {
60
- return (_jsx(Dialog.Root, { open: isSsoOpen, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex h-[333px] w-[375px] flex-col items-center space-y-4 bg-[#111827] p-6 text-center", style: {
61
- backgroundImage: `url(${lightBg.src})`,
62
- }, children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px]" }), _jsx("div", { className: "mb-4 h-7 w-7 animate-spin rounded-full border-4 border-[#101730] border-t-[#F05027]" }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "We\u2019re creating an account for you..." }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "In the meantime, you can watch your favorite series on CinePop!" }), _jsxs("div", { className: "pt-3", children: [_jsx(Image, { src: cinePopLogo, alt: "cine poplogo", width: 151, height: 24, className: "mx-auto mb-2 h-auto w-[151px]" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { src: secretConfessionsLogo, alt: "secret confessions logo", width: 104, height: 53, className: "h-auto w-[104px]" }), _jsx(Image, { src: dearUtolLogo, alt: "dear utol logo", width: 105, height: 53, className: "h-auto w-[105px]" }), _jsx(Image, { src: mariasDiary, alt: "maria's diary logo", width: 104, height: 53, className: "h-auto w-[104px]" })] })] })] }) })] }) }));
63
- }
64
- if (showVerifyDialog) {
65
- return (_jsx(VerifyMobileNumber, { onClose: () => {
66
- setShowVerifyDialog(false);
67
- router.push('/');
68
- } }));
69
- }
70
- return null;
71
- }
72
- export function VerifyMobileNumber({ onClose }) {
73
- const [step, setStep] = useState(1);
74
- const sendVerificationCodeMutation = useSendVerificationCodeMutation({
75
- onSuccess: () => {
76
- setStep(2);
77
- cooldown.start();
78
- },
79
- onError: (err) => {
80
- toaster.error({
81
- title: 'Sign In Failed',
82
- description: err.message,
83
- });
84
- },
85
- });
86
- const verifyMobileNumberMutation = useVerifyMobileNumber({
87
- onSuccess: async () => {
88
- step1Form.reset();
89
- step2Form.reset();
90
- setStep(1);
91
- toaster.success({
92
- title: 'Verification Successful',
93
- description: 'Your mobile number has been verified.',
94
- });
95
- onClose?.();
96
- },
97
- onError: (err) => {
98
- const errorMessage = err.name === 'Forbidden'
99
- ? 'Please enter the correct verification code'
100
- : err.message;
101
- toaster.error({
102
- title: 'Sign In Failed',
103
- description: errorMessage,
104
- });
105
- },
106
- });
107
- const localeInfo = useLocaleInfo();
108
- const mobileNumberParser = useMobileNumberParser();
109
- const Step1Definition = z.object({
110
- mobileNumber: z
111
- .string()
112
- .min(1, 'Mobile number is required')
113
- .superRefine((v, ctx) => {
114
- if (!mobileNumberParser.validate(v)) {
115
- ctx.addIssue({
116
- code: z.ZodIssueCode.custom,
117
- message: 'Invalid mobile number',
118
- });
119
- }
120
- }),
121
- });
122
- const Step2Definition = z.object({
123
- verificationCode: z.array(z.string()).superRefine((val, ctx) => {
124
- if (val.length !== 6 || val.some((v) => v.length !== 1)) {
125
- ctx.addIssue({
126
- code: z.ZodIssueCode.custom,
127
- message: 'Please enter your 6-digit verification code.',
128
- });
129
- }
130
- }),
131
- });
132
- const step1Form = useForm({
133
- resolver: zodResolver(Step1Definition),
134
- defaultValues: {
135
- mobileNumber: '',
136
- },
137
- });
138
- const step2Form = useForm({
139
- resolver: zodResolver(Step2Definition),
140
- defaultValues: {
141
- verificationCode: Array.from({ length: 6 }).fill(''),
142
- },
143
- });
144
- const cooldown = useCooldown({
145
- max: 60,
146
- duration: 1000 * 60,
147
- });
148
- const formRef = useRef(null);
149
- return (_jsx(Dialog.Root, { open: true, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-[375px] flex-col items-center space-y-4 rounded-xl bg-[#111827] p-6 text-center", style: {
150
- backgroundImage: `url(${lightBg.src})`,
151
- }, children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px]" }), _jsxs("div", { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold text-sm", children: ["Get ", _jsx("span", { className: "text-[#F05127]", children: "\u20B150 Bonus" }), " when you verify your account and play."] }), _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
152
- sendVerificationCodeMutation.mutateAsync({
153
- channel: 'SMS',
154
- recipient: mobileNumberParser.format(data.mobileNumber),
155
- strict: true,
156
- });
157
- }), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "text-left", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode }) }), _jsx(Field.Input, { style: {
158
- paddingLeft: `calc(1.25rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
159
- }, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Send Code" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold text-[#F05127]", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: formRef, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
160
- verifyMobileNumberMutation.mutateAsync({
161
- verificationCode: verificationCode.join(''),
162
- });
163
- }), children: [_jsx(Controller, { name: "verificationCode", control: step2Form.control, render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsxs(PinInput.Root, { placeholder: "0", onKeyDown: (e) => {
164
- if (e.key === 'Backspace') {
165
- step2Form.reset();
166
- }
167
- }, value: o.field.value, onValueChange: (details) => {
168
- o.field.onChange(details.value);
169
- o.field.onBlur();
170
- }, otp: true, onValueComplete: () => {
171
- formRef.current?.requestSubmit();
172
- }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-4 flex w-full items-center justify-center gap-xs text-xs", children: [_jsx("span", { className: "text-[#9CA3AF]", children: "Didn't receive the code?" }), _jsx("button", { type: "button", className: "font-semibold text-[#C084FC]", disabled: cooldown.cooling, onClick: async () => {
173
- await sendVerificationCodeMutation.mutateAsync({
174
- channel: 'SMS',
175
- recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
176
- });
177
- cooldown.start();
178
- }, children: cooldown.cooling
179
- ? `Resend in ${cooldown.countdown}s`
180
- : 'Resend' })] }), _jsx("button", { type: "button", className: "absolute top-0 left-6 mx-auto mt-3xl flex h-8 w-8 items-center gap-1 rounded-full bg-[#1f2638] font-semibold text-sm text-text-tertiary-600", onClick: () => {
181
- setStep(1);
182
- step2Form.reset();
183
- cooldown.stop();
184
- }, children: _jsx(ArrowLeftIcon, { className: "mx-auto size-5" }) })] })] }))] })] }) })] }) }));
185
- }
@@ -1 +0,0 @@
1
- export * from './SingleSignOn';
@@ -1 +0,0 @@
1
- export * from './SingleSignOn.js';