@opexa/portal-components 0.0.428 → 0.0.429

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 (86) hide show
  1. package/dist/components/Banner/Banner.client.d.ts +12 -0
  2. package/dist/components/Banner/Banner.client.js +49 -0
  3. package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
  4. package/dist/components/DigitainLauncher/Loading.js +5 -0
  5. package/dist/components/Disclaimer/DisclaimerV1.js +9 -9
  6. package/dist/components/KYC/BasicInformation.d.ts +1 -0
  7. package/dist/components/KYC/BasicInformation.js +101 -0
  8. package/dist/components/KYC/IdentityVerification.d.ts +1 -0
  9. package/dist/components/KYC/IdentityVerification.js +120 -0
  10. package/dist/components/KYC/Indicator.d.ts +1 -0
  11. package/dist/components/KYC/Indicator.js +8 -0
  12. package/dist/components/KYC/KYC.lazy.d.ts +6 -0
  13. package/dist/components/KYC/KYC.lazy.js +45 -0
  14. package/dist/components/KYC/KYCContext.d.ts +6 -0
  15. package/dist/components/KYC/KYCContext.js +2 -0
  16. package/dist/components/KYC/PersonalInformation.d.ts +1 -0
  17. package/dist/components/KYC/PersonalInformation.js +122 -0
  18. package/dist/components/KYC/useKYC.d.ts +25 -0
  19. package/dist/components/KYC/useKYC.js +38 -0
  20. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
  21. package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
  22. package/dist/components/SignIn/SignIn.lazy.js +1 -1
  23. package/dist/components/SignIn/utils.d.ts +8 -0
  24. package/dist/components/SignIn/utils.js +26 -0
  25. package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +1 -1
  26. package/dist/constants/Branches.d.ts +2 -0
  27. package/dist/constants/Branches.js +42 -0
  28. package/dist/constants/EnvVar.d.ts +1 -1
  29. package/dist/handlers/index.d.ts +7 -7
  30. package/dist/images/responsible-gaming-yellow.png +0 -0
  31. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  32. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  33. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  34. package/dist/third-parties/FacebookPixel/api.js +1 -0
  35. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  36. package/dist/third-parties/FacebookPixel/index.js +1 -0
  37. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  38. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  39. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  40. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  41. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  42. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  43. package/dist/third-parties/index.d.ts +2 -0
  44. package/dist/third-parties/index.js +2 -0
  45. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  46. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  47. package/dist/ui/Badge/Badge.d.ts +12 -12
  48. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  49. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  50. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  51. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  52. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  53. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  54. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  55. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  56. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  57. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  58. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  59. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  60. package/dist/ui/Dialog/Dialog.d.ts +231 -495
  61. package/dist/ui/Dialog/dialog.recipe.d.ts +15 -39
  62. package/dist/ui/Dialog/dialog.recipe.js +9 -1
  63. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  64. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  65. package/dist/ui/Menu/Menu.d.ts +198 -198
  66. package/dist/ui/Menu/menu.recipe.d.ts +11 -11
  67. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  68. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  69. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  70. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  71. package/dist/ui/PinInput/PinInput.d.ts +12 -12
  72. package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
  73. package/dist/ui/Popover/Popover.d.ts +55 -55
  74. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  75. package/dist/ui/Progress/Progress.d.ts +27 -27
  76. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  77. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  78. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  79. package/dist/ui/Select/Select.d.ts +45 -45
  80. package/dist/ui/Select/select.recipe.d.ts +3 -3
  81. package/dist/ui/Table/Table.d.ts +21 -21
  82. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  83. package/dist/ui/Table/table.recipe.d.ts +3 -3
  84. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  85. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  86. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ import { addHours } from 'date-fns';
3
+ import { clamp } from 'lodash-es';
4
+ import { useLocalStorage, useTimeout } from 'usehooks-ts';
5
+ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
6
+ export function CXDTokenObserver() {
7
+ const { data: account } = useAccountQuery();
8
+ const accountCxd = {
9
+ cxd: account?.cellxpertDetails?.cxd,
10
+ };
11
+ const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
12
+ const now = new Date();
13
+ const removeCxdUntilInMs = cxd?.timestamp
14
+ ? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
15
+ : 0;
16
+ useTimeout(() => {
17
+ const isSame = cxd?.cxd === accountCxd.cxd;
18
+ if (!isSame) {
19
+ const extendedTimestamp = addHours(new Date(), 6).getTime();
20
+ setCxd({
21
+ cxd: accountCxd.cxd,
22
+ timestamp: extendedTimestamp,
23
+ });
24
+ }
25
+ }, account ? 100 : null);
26
+ useTimeout(() => {
27
+ removeCxd();
28
+ }, account ? removeCxdUntilInMs : null);
29
+ return null;
30
+ }
@@ -23,5 +23,5 @@ export function SignIn(props) {
23
23
  // Reset checkbox state when dialog closes
24
24
  globalStore.termsAndConditions.setAccepted(false);
25
25
  globalStore.responsibleGaming.setAccepted(false);
26
- }, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className?.root), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-7.5 w-auto", draggable: false }), _jsx(SignInForm, {})] }) })] }) }) }) }));
26
+ }, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:min-h-[80vh] lg:w-[400px] lg:rounded-xl', props.className?.root), style: { msOverflowStyle: 'none', scrollbarWidth: 'none' }, children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-7.5 w-auto", draggable: false }), _jsx(SignInForm, {})] }) })] }) }) }) }));
27
27
  }
@@ -0,0 +1,8 @@
1
+ type Options = {
2
+ accountName?: string;
3
+ siteName?: string;
4
+ signInOptions?: 'MOBILE_NUMBER' | 'NAME_AND_PASSWORD';
5
+ };
6
+ export type ErrorCode = 'MEMBER_ACCOUNT_BLACKLISTED' | 'MEMBER_ACCOUNT_SUSPENDED' | 'INVALID_RECAPTCHA_RESPONSE' | 'MEMBER_NOT_FOUND' | 'RATE_LIMIT_REACH' | 'NOT_READY_TO_SEND_VERIFICATION_ERROR' | 'Forbidden';
7
+ export declare function getFriendlyErrorMessage(code: ErrorCode, options?: Options): string;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ export function getFriendlyErrorMessage(code, options) {
2
+ const accountName = options?.accountName ?? '';
3
+ const siteName = options?.siteName ?? '';
4
+ const signInOptions = options?.signInOptions ?? 'NAME_AND_PASSWORD';
5
+ switch (code) {
6
+ case 'MEMBER_ACCOUNT_BLACKLISTED':
7
+ return `Your account ${accountName} has been blacklisted due to a serious violation of our policies. For more information or to appeal, please contact the ${siteName} Chat Support team.`;
8
+ case 'MEMBER_ACCOUNT_SUSPENDED':
9
+ return `Your account ${accountName} has been temporarily suspended. Please reach out to the ${siteName} Chat Support team to learn more and get help with resolving the issue.`;
10
+ case 'INVALID_RECAPTCHA_RESPONSE':
11
+ return 'Invalid reCAPTCHA response';
12
+ case 'MEMBER_NOT_FOUND':
13
+ return 'Account not found. Please check your username and try again.';
14
+ case 'RATE_LIMIT_REACH':
15
+ return 'Rate limit exceeded';
16
+ case 'NOT_READY_TO_SEND_VERIFICATION_ERROR':
17
+ return 'Your account is not ready to send verification requests. Please try again later.';
18
+ case 'Forbidden':
19
+ if (signInOptions === 'MOBILE_NUMBER') {
20
+ return 'Invalid verification code. Please check the code and try again.';
21
+ }
22
+ return 'Invalid username or password, please try again.';
23
+ default:
24
+ return 'Something went wrong. Please try again later.';
25
+ }
26
+ }
@@ -22,5 +22,5 @@ export function SignUpDefault(props) {
22
22
  // Reset checkbox state when dialog closes
23
23
  globalStore.termsAndConditions.setAccepted(false);
24
24
  globalStore.responsibleGaming.setAccepted(false);
25
- }, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:h-fit lg:w-[400px] lg:rounded-xl', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent', props.className?.root), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpDefaultForm, {}) })] }) })] }) }) }));
25
+ }, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:min-h-[80vh] lg:w-[400px] lg:rounded-xl', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent', props.className?.root), style: { msOverflowStyle: 'none', scrollbarWidth: 'none' }, children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpDefaultForm, {}) })] }) })] }) }) }));
26
26
  }
@@ -0,0 +1,2 @@
1
+ import type { Branch } from '../types';
2
+ export declare const BRANCHES: Branch[];
@@ -0,0 +1,42 @@
1
+ export const BRANCHES = [
2
+ {
3
+ code: 'BRCAL',
4
+ name: 'Bingo Republic 2nd floor Primark Center Deparo St., Caloocan City',
5
+ },
6
+ {
7
+ code: 'BRNAG',
8
+ name: 'Bingo Republic 3rd floor Robinsons Mall, Naga City, Camarines Sur',
9
+ },
10
+ {
11
+ code: 'BRANT',
12
+ name: 'Bingo Republic 2nd floor Robinsons Mall, San Vicente,Antique',
13
+ },
14
+ {
15
+ code: 'BRCLA',
16
+ name: 'Clark',
17
+ },
18
+ {
19
+ code: 'BRLAG',
20
+ name: 'Laguna',
21
+ },
22
+ {
23
+ code: 'BREAS',
24
+ name: 'Eastwood City, Quezon City',
25
+ },
26
+ {
27
+ code: 'BRMAR',
28
+ name: 'Bingo ng Bayan 4th floor Marikina Public Market, Marikina City',
29
+ },
30
+ {
31
+ code: 'BRILO',
32
+ name: 'Iloilo',
33
+ },
34
+ {
35
+ code: 'BRFIM',
36
+ name: 'Fisher Mall,Quezon City',
37
+ },
38
+ {
39
+ code: 'BRCAC',
40
+ name: 'Villa Caceres Hotel, Naga City,Camsur',
41
+ },
42
+ ];
@@ -1,5 +1,5 @@
1
1
  export declare const SITE_ID: string;
2
2
  export declare const PLATFORM_ID: string;
3
3
  export declare const PLATFORM_CODE: string;
4
- export declare const ENVIRONMENT: "production" | "development";
4
+ export declare const ENVIRONMENT: "development" | "production";
5
5
  export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
@@ -6,13 +6,6 @@ interface Context {
6
6
  params: Promise<Params>;
7
7
  }
8
8
  export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
9
- ok: false;
10
- message: string;
11
- __error?: unknown;
12
- } | {
13
- ok: true;
14
- data: import("../types").Session;
15
- }> | NextResponse<{
16
9
  ok: true;
17
10
  data?: never;
18
11
  } | {
@@ -26,6 +19,13 @@ export declare const GET: (req: NextRequest, { params }: Context) => Promise<Nex
26
19
  } | {
27
20
  ok: true;
28
21
  data: Record<string, unknown>;
22
+ }> | NextResponse<{
23
+ ok: false;
24
+ message: string;
25
+ __error?: unknown;
26
+ } | {
27
+ ok: true;
28
+ data: import("../types").Session;
29
29
  }>>;
30
30
  export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
31
31
  ok: true;
@@ -0,0 +1,4 @@
1
+ export interface FacebookPixelProps {
2
+ fbId: string;
3
+ }
4
+ export declare function FacebookPixel(props: FacebookPixelProps): null;
@@ -0,0 +1,4 @@
1
+ export function FacebookPixel(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel';
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel.js';
@@ -0,0 +1,4 @@
1
+ export interface GoogleRecaptchaProps {
2
+ siteKey: string;
3
+ }
4
+ export declare function GoogleRecaptcha(props: GoogleRecaptchaProps): null;
@@ -0,0 +1,4 @@
1
+ export function GoogleRecaptcha(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha';
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha.js';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel';
2
+ export * from './GoogleRecaptcha';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel/index.js';
2
+ export * from './GoogleRecaptcha/index.js';