@opexa/portal-components 0.0.980 → 0.0.982

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 (56) hide show
  1. package/dist/components/AccountInfo/AccountInfo.js +2 -2
  2. package/dist/components/KYC/KYCDefault/KYCDefault.js +1 -2
  3. package/dist/components/KYC/KycOpenOnHomeMount.js +12 -4
  4. package/dist/components/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.js +8 -20
  5. package/dist/schemas/forgotPasswordSchema.d.ts +5 -5
  6. package/dist/ui/AlertDialog/AlertDialog.d.ts +187 -187
  7. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +17 -17
  8. package/dist/ui/Badge/Badge.d.ts +12 -12
  9. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  10. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  11. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  12. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  13. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  14. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  15. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  16. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  17. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  18. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  19. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  20. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  21. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  22. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  23. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  24. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  25. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  26. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  27. package/dist/ui/Menu/Menu.d.ts +360 -360
  28. package/dist/ui/Menu/menu.recipe.d.ts +20 -20
  29. package/dist/ui/Popover/Popover.d.ts +154 -154
  30. package/dist/ui/Popover/popover.recipe.d.ts +14 -14
  31. package/dist/ui/Progress/Progress.d.ts +27 -27
  32. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  33. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  34. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  35. package/dist/ui/Select/Select.d.ts +45 -45
  36. package/dist/ui/Select/select.recipe.d.ts +3 -3
  37. package/dist/ui/Table/Table.d.ts +21 -21
  38. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  39. package/dist/ui/Table/table.recipe.d.ts +3 -3
  40. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  41. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  42. package/dist/ui/Tooltip/Tooltip.d.ts +30 -30
  43. package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
  44. package/package.json +1 -1
  45. package/dist/client/hooks/useVerifyMobileNumber.d.ts +0 -3
  46. package/dist/client/hooks/useVerifyMobileNumber.js +0 -20
  47. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.d.ts +0 -1
  48. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +0 -241
  49. package/dist/components/SingleSignOn/SingleSignOn.d.ts +0 -4
  50. package/dist/components/SingleSignOn/SingleSignOn.js +0 -185
  51. package/dist/components/SingleSignOn/index.d.ts +0 -1
  52. package/dist/components/SingleSignOn/index.js +0 -1
  53. package/dist/lib/components/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.d.ts +0 -1
  54. package/dist/lib/components/UpdateMobilePhoneNumber/UpdateMobilePhoneNumber.js +0 -152
  55. package/dist/lib/components/UpdateMobilePhoneNumber/index.d.ts +0 -1
  56. package/dist/lib/components/UpdateMobilePhoneNumber/index.js +0 -1
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ark } from '@ark-ui/react/factory';
4
4
  import FacebookLogin from '@greatsumini/react-facebook-login';
5
5
  import { zodResolver } from '@hookform/resolvers/zod';
@@ -160,7 +160,7 @@ function PersonalInfo(props) {
160
160
  ? data.birthDay
161
161
  : undefined,
162
162
  });
163
- }), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay'), className: twMerge('h-full py-2.5', account?.birthDay && 'pointer-events-none') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), props.shouldShowBranchCode && (_jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Branch Code" }), _jsx(Field.Input, { type: "text", disabled: true, value: displayBranchName ?? account?.branchCode ?? '' })] })), featureFlag.enabled && (_jsxs(_Fragment, { children: [_jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Address" }), _jsx(Field.Input, { type: "text", readOnly: true, value: verification?.address ?? '' })] }), _jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Nature of Work" }), _jsx(Field.Input, { type: "text", readOnly: true, value: verification?.natureOfWork ?? '' })] })] }))] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
163
+ }), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay'), className: twMerge('h-full py-2.5', account?.birthDay && 'pointer-events-none') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), props.shouldShowBranchCode && (_jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Branch Code" }), _jsx(Field.Input, { type: "text", disabled: true, value: displayBranchName ?? account?.branchCode ?? '' })] })), _jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Address" }), _jsx(Field.Input, { type: "text", readOnly: true, value: verification?.address ?? '' })] }), _jsxs(Field.Root, { className: "mt-6", readOnly: true, children: [_jsx(Field.Label, { children: "Nature of Work" }), _jsx(Field.Input, { type: "text", readOnly: true, value: verification?.natureOfWork ?? '' })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
164
164
  }
165
165
  function ContactInfo({ variant }) {
166
166
  const localeInfo = useLocaleInfo();
@@ -25,8 +25,7 @@ export function KYCDefault(props) {
25
25
  const isDialogOpen = globalStore.kyc.open &&
26
26
  !globalStore.kycReminder.open &&
27
27
  !sessionLoading &&
28
- !globalStore.disclaimer.open &&
29
- !globalStore.updateMobilePhoneNumber.open;
28
+ !globalStore.disclaimer.open;
30
29
  return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen, onOpenChange: (details) => {
31
30
  globalStore.kyc.setOpen(details.open);
32
31
  }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props }), _jsx(KYCReview, {})] }));
@@ -28,11 +28,8 @@ export function KycOpenOnHomeMount(props) {
28
28
  const hasSeenKycModal = sessionStorage.getItem('hasSeenKycModal');
29
29
  const isFirstVisit = !hasSeenKycModal;
30
30
  // Handle member verification locked FIRST (highest priority)
31
- if (isVerificationLocked) {
32
- setkycReminderOpen(true);
33
- }
34
31
  // Handle rejected verification status
35
- else if (isRejected) {
32
+ if (isRejected) {
36
33
  if (isFirstVisit) {
37
34
  setkycReminderOpen(false);
38
35
  setkycOpen(true);
@@ -55,6 +52,17 @@ export function KycOpenOnHomeMount(props) {
55
52
  setkycOpen(!shouldShowReminder);
56
53
  }
57
54
  }
55
+ else if (isVerificationLocked) {
56
+ if (isFirstVisit) {
57
+ setkycReminderOpen(true);
58
+ setkycOpen(false);
59
+ }
60
+ else {
61
+ sessionStorage.setItem('hasSeenKycModal', 'true');
62
+ setkycReminderOpen(!shouldShowReminder);
63
+ setkycOpen(shouldShowReminder);
64
+ }
65
+ }
58
66
  // Handle completed kyc progress
59
67
  else if (isKycCompleted) {
60
68
  setkycReminderOpen(false);
@@ -5,10 +5,8 @@ import Image from 'next/image';
5
5
  import { useEffect, useRef, useState } from 'react';
6
6
  import { Controller, useForm } from 'react-hook-form';
7
7
  import z from 'zod';
8
- import { useShallow } from 'zustand/shallow';
9
8
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
10
9
  import { useCooldown } from '../../client/hooks/useCooldown.js';
11
- import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
12
10
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
13
11
  import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
14
12
  import { useSendVerificationCodeMutation } from '../../client/hooks/useSendVerificationCodeMutation.js';
@@ -23,34 +21,25 @@ import { Field } from '../../ui/Field/index.js';
23
21
  import { PinInput } from '../../ui/PinInput/index.js';
24
22
  import { Portal } from '../../ui/Portal/index.js';
25
23
  export function UpdateMobilePhoneNumber() {
26
- const globalStore = useGlobalStore(useShallow((ctx) => ({
27
- updateMobilePhoneNumber: ctx.updateMobilePhoneNumber,
28
- kyc: ctx.kyc,
29
- })));
30
24
  const accountQuery = useAccountQuery();
31
25
  const account = accountQuery.data;
32
26
  const isAccountLoading = accountQuery.isLoading;
33
27
  const hasMobileNumber = !!account?.mobileNumber;
28
+ const [open, setOpen] = useState(false);
34
29
  const hasExecuted = useRef(false);
35
30
  useEffect(() => {
36
31
  if (!isAccountLoading && !!account && !hasExecuted.current) {
37
32
  if (!hasMobileNumber) {
38
- console.log('No mobile number found');
39
- globalStore.updateMobilePhoneNumber.setOpen(true);
33
+ setTimeout(() => {
34
+ setOpen(true);
35
+ }, 500);
40
36
  }
41
37
  else {
42
- console.log('Mobile number found');
43
- globalStore.updateMobilePhoneNumber.setOpen(false);
38
+ setOpen(false);
44
39
  }
45
40
  hasExecuted.current = true;
46
41
  }
47
- }, [
48
- isAccountLoading,
49
- account,
50
- hasMobileNumber,
51
- globalStore.updateMobilePhoneNumber,
52
- ]);
53
- console.log('UpdateMobilePhoneNumber open:', globalStore.updateMobilePhoneNumber.open);
42
+ }, [isAccountLoading, account, hasMobileNumber]);
54
43
  const [step, setStep] = useState(1);
55
44
  const sendVerificationCodeMutation = useSendVerificationCodeMutation({
56
45
  onSuccess: () => {
@@ -73,8 +62,7 @@ export function UpdateMobilePhoneNumber() {
73
62
  title: 'Verification Successful',
74
63
  description: 'Your mobile number has been verified.',
75
64
  });
76
- globalStore.updateMobilePhoneNumber.setOpen(false);
77
- globalStore.kyc.setOpen(true);
65
+ setOpen(false);
78
66
  },
79
67
  onError: (err) => {
80
68
  const errorMessage = err.message === 'Internal Server Error'
@@ -128,7 +116,7 @@ export function UpdateMobilePhoneNumber() {
128
116
  duration: 1000 * 60,
129
117
  });
130
118
  const formRef = useRef(null);
131
- return (_jsx(Dialog.Root, { open: globalStore.updateMobilePhoneNumber.open, 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: {
119
+ return (_jsx(Dialog.Root, { open: open, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: '!z-[calc(var(--z-dialog)+2)] 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: {
132
120
  backgroundImage: `url(${lightBg.src})`,
133
121
  }, 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) => {
134
122
  sendVerificationCodeMutation.mutateAsync({
@@ -8,25 +8,25 @@ export declare const createForgotPasswordSchema: (mobileNumberParser: MobileNumb
8
8
  mobileNumber: z.ZodEffects<z.ZodString, string, string>;
9
9
  verificationCode: z.ZodEffects<z.ZodString, string, string>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- password: string;
12
- confirmPassword: string;
13
11
  mobileNumber: string;
14
12
  verificationCode: string;
15
- }, {
16
13
  password: string;
17
14
  confirmPassword: string;
15
+ }, {
18
16
  mobileNumber: string;
19
17
  verificationCode: string;
20
- }>, {
21
18
  password: string;
22
19
  confirmPassword: string;
20
+ }>, {
23
21
  mobileNumber: string;
24
22
  verificationCode: string;
25
- }, {
26
23
  password: string;
27
24
  confirmPassword: string;
25
+ }, {
28
26
  mobileNumber: string;
29
27
  verificationCode: string;
28
+ password: string;
29
+ confirmPassword: string;
30
30
  }>;
31
31
  export type ForgotPasswordSchema = z.infer<ReturnType<typeof createForgotPasswordSchema>>;
32
32
  export {};