@opexa/portal-components 0.0.569 → 0.0.571
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/dist/components/KYC/KYCReminder.lazy.js +11 -9
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/Quests/JourneyQuest.js +2 -2
- package/dist/handlers/index.d.ts +7 -7
- package/dist/styles/theme.css +10 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +2 -2
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
- package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
- package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
- package/dist/components/DigitainLauncher/Loading.js +0 -5
- package/dist/components/KYC/BasicInformation.d.ts +0 -1
- package/dist/components/KYC/BasicInformation.js +0 -101
- package/dist/components/KYC/IdentityVerification.d.ts +0 -1
- package/dist/components/KYC/IdentityVerification.js +0 -120
- package/dist/components/KYC/Indicator.d.ts +0 -1
- package/dist/components/KYC/Indicator.js +0 -8
- package/dist/components/KYC/KYC.lazy.d.ts +0 -6
- package/dist/components/KYC/KYC.lazy.js +0 -45
- package/dist/components/KYC/KYCContext.d.ts +0 -6
- package/dist/components/KYC/KYCContext.js +0 -2
- package/dist/components/KYC/PersonalInformation.d.ts +0 -1
- package/dist/components/KYC/PersonalInformation.js +0 -122
- package/dist/components/KYC/useKYC.d.ts +0 -25
- package/dist/components/KYC/useKYC.js +0 -38
- package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
- package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
- package/dist/components/SessionWatcher/index.d.ts +0 -1
- package/dist/components/SessionWatcher/index.js +0 -1
- package/dist/icons/LinkBrokenIcon.d.ts +0 -2
- package/dist/icons/LinkBrokenIcon.js +0 -4
- package/dist/images/responsible-gaming-yellow.png +0 -0
|
@@ -45,14 +45,16 @@ export function KYCReminder(props) {
|
|
|
45
45
|
const now = new Date();
|
|
46
46
|
return differenceInCalendarDays(now, creationDate);
|
|
47
47
|
}, [account?.dateTimeCreated]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
const isSessionReady = !sessionLoading && session?.status === 'authenticated';
|
|
49
|
+
const isAccountReady = !accountLoading;
|
|
50
|
+
const isKYCReminderOpen = globalStore.kycReminder.open && !globalStore.kyc.open;
|
|
51
|
+
const isResponsibleGamingReminderClosed = !globalStore.responsibleGamingReminder.open;
|
|
52
|
+
const isKYCStateRelevant = isNotVerified || ((isPending || isVerificationLocked) && featureFlag.enabled);
|
|
53
|
+
return (_jsx(Dialog.Root, { open: isSessionReady &&
|
|
54
|
+
isAccountReady &&
|
|
55
|
+
isKYCReminderOpen &&
|
|
56
|
+
isKYCStateRelevant &&
|
|
57
|
+
isResponsibleGamingReminderClosed, onOpenChange: (details) => {
|
|
56
58
|
globalStore.kycReminder.setOpen(details.open);
|
|
57
59
|
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary lg:max-w-[400px]", children: [isVerificationLocked &&
|
|
58
60
|
!isPending &&
|
|
@@ -69,7 +71,7 @@ export function KYCReminder(props) {
|
|
|
69
71
|
responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: `h-[50px] w-auto shrink-0 ${props.responsibleGamingLogo?.styles ?? ''}`, draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
|
|
70
72
|
api.setOpen(false);
|
|
71
73
|
globalStore.kyc.setOpen(true);
|
|
72
|
-
}, children: "Complete KYC" }) })) })] })] })),
|
|
74
|
+
}, children: "Complete KYC" }) })) })] })] })), isNotVerified && !isVerificationLocked && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-primary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Personal Verification" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
73
75
|
api.setOpen(false);
|
|
74
76
|
globalStore.kyc.setOpen(true);
|
|
75
77
|
}, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })), isPending && featureFlag.enabled && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-primary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "VERIFICATION IN PROGRESS" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account is verification-locked. Please wait for approval to regain full access to this platform." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: props.pagcorLogo?.logo ?? pagcorLogo, alt: "PAGCOR logo", height: 88, width: 88, className: `h-[88px] w-auto shrink-0 ${props.pagcorLogo?.styles ?? ''}`, draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo?.logo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: `h-[50px] w-auto shrink-0 ${props.responsibleGamingLogo?.styles ?? ''}`, draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { addHours } from 'date-fns';
|
|
3
3
|
import { clamp } from 'lodash-es';
|
|
4
|
-
import { useSearchParams } from 'next/navigation';
|
|
5
4
|
import { useLocalStorage, useTimeout } from 'usehooks-ts';
|
|
6
5
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
7
6
|
export function CXDTokenObserver() {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const [cxd, setCxd, removeCxd] = useLocalStorage('
|
|
7
|
+
const { data: account } = useAccountQuery();
|
|
8
|
+
const accountCxd = {
|
|
9
|
+
cxd: account?.cellxpertDetails?.cxd,
|
|
10
|
+
};
|
|
11
|
+
const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
|
|
13
12
|
const now = new Date();
|
|
14
|
-
const shouldTimeoutRun = cxdToken && account;
|
|
15
13
|
const removeCxdUntilInMs = cxd?.timestamp
|
|
16
14
|
? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
|
|
17
15
|
: 0;
|
|
18
16
|
useTimeout(() => {
|
|
19
|
-
const isSame = cxd?.cxd ===
|
|
17
|
+
const isSame = cxd?.cxd === accountCxd.cxd;
|
|
20
18
|
if (!isSame) {
|
|
21
19
|
const extendedTimestamp = addHours(new Date(), 6).getTime();
|
|
22
20
|
setCxd({
|
|
23
|
-
cxd:
|
|
21
|
+
cxd: accountCxd.cxd,
|
|
24
22
|
timestamp: extendedTimestamp,
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
|
-
},
|
|
28
|
-
useTimeout(() =>
|
|
25
|
+
}, account ? 100 : null);
|
|
26
|
+
useTimeout(() => {
|
|
27
|
+
removeCxd();
|
|
28
|
+
}, account ? removeCxdUntilInMs : null);
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
@@ -82,7 +82,7 @@ export function JourneyQuest(props) {
|
|
|
82
82
|
const localeInfo = useLocaleInfo();
|
|
83
83
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-center justify-between", children: [_jsx(RemainingTime, { endOfDay: true }), quest.status === 'COMPLETED' && (_jsx(Badge.Root, { colorScheme: "success", size: "lg", round: false, children: _jsxs(Badge.Label, { children: ["Final Bonus:", ' ', formatNumber(quest.bonus, {
|
|
84
84
|
currency: localeInfo.currency.code,
|
|
85
|
-
})] }) }))] }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Journey Quest' }), _jsxs("div", { className: "flex w-full items-center space-x-2", children: [_jsx(Progress.Root, { max: 100, className: "h-2 rounded-full bg-bg-primary", value: progressValue, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {
|
|
85
|
+
})] }) }))] }), _jsx("p", { className: "font-semibold text-xl", children: quest?.name || 'Journey Quest' }), _jsxs("div", { className: "flex w-full items-center space-x-2", children: [_jsx(Progress.Root, { max: 100, className: "h-2 rounded-full bg-bg-primary", value: progressValue, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsxs("p", { className: "text-text-quarterary-brand text-xs", children: [currentMilestone, "/", totalMilestones] })] }), _jsx("div", { className: "flex w-full flex-col space-y-3", children: milestones.map((milestone) => (_jsx(QuestMilestone, { label: milestone.label, bonus: milestone.bonus, isCompleted: milestone.isCompleted, checkboxControlStyle: props.checkboxControlStyle, className: {
|
|
86
86
|
name: classNames?.checkboxName,
|
|
87
87
|
bonus: classNames?.checkboxBonus,
|
|
88
88
|
} }, milestone.key))) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: handleViewDetails, "aria-label": "View Details", disabled: false, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen, quest: quest, milestones: milestones, className: {
|
|
@@ -140,7 +140,7 @@ function Rules(props) {
|
|
|
140
140
|
? 'Deposit'
|
|
141
141
|
: 'Verify Account'] })), !milestone.isCompleted &&
|
|
142
142
|
milestone.key === 'LINK_FACEBOOK_ACCOUNT' && (_jsxs(_Fragment, { children: [milestone.bonus && (_jsxs("p", { className: "text-[#94969C] text-sm", children: ["Link your Facebook Account and get Php", ' ', milestone.bonus, " Bonus"] })), _jsx(FacebookSignInTrigger, { text: "Link Facebook Account", className: "!mt-0 flex h-10 w-full items-center justify-center gap-md rounded-md bg-button-primary-bg px-3 font-semibold text-button-primary-fg text-sm shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none" })] })), !milestone.isCompleted &&
|
|
143
|
-
milestone.key === 'LINK_GOOGLE_ACCOUNT' && (_jsxs(_Fragment, { children: [milestone.bonus && (_jsxs("p", { className: "text-[#94969C] text-sm", children: ["Link your Google Account and get Php", ' ', milestone.bonus, " Bonus"] })), _jsx(GoogleSignInButton, { text: "Link Google Account", className: "flex h-10 w-full items-center justify-center gap-md rounded-md bg-button-primary-bg px-3 font-semibold text-button-primary-fg text-sm shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none" })] }))] }, milestone.key))), quest?.bonus && (_jsx("div", { className: "flex h-full items-end", children: allMilestonesCompleted ? (_jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })) : (_jsx("div", { className: twMerge(
|
|
143
|
+
milestone.key === 'LINK_GOOGLE_ACCOUNT' && (_jsxs(_Fragment, { children: [milestone.bonus && (_jsxs("p", { className: "text-[#94969C] text-sm", children: ["Link your Google Account and get Php", ' ', milestone.bonus, " Bonus"] })), _jsx(GoogleSignInButton, { text: "Link Google Account", className: "flex h-10 w-full items-center justify-center gap-md rounded-md bg-button-primary-bg px-3 font-semibold text-button-primary-fg text-sm shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none" })] }))] }, milestone.key))), quest?.bonus && (_jsx("div", { className: "flex h-full items-end", children: allMilestonesCompleted ? (_jsx(Button, { size: "sm", onClick: () => setOpen(false), "aria-label": "Close", className: "w-full", children: "Close" })) : (_jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center text-white', props.className?.uncompleteButton), children: _jsxs("p", { children: ["Complete target to", ' ', _jsxs("span", { className: "text-brand-400", children: ["\u20B1", quest?.bonus] }), ' ', "bonus!"] }) })) }))] })] }) })] }) }));
|
|
144
144
|
}
|
|
145
145
|
function QuestMilestone({ label, bonus, isCompleted = false, checkboxControlStyle, className, }) {
|
|
146
146
|
const localeInfo = useLocaleInfo();
|
package/dist/handlers/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/styles/theme.css
CHANGED
|
@@ -273,7 +273,16 @@
|
|
|
273
273
|
|
|
274
274
|
|
|
275
275
|
--color-border-checkbox-primary: #373a41;
|
|
276
|
-
--color-bg-
|
|
276
|
+
--color-bg-checkbox-primary: var(--color-bg-primary);
|
|
277
|
+
--color-border-checkbox-checked-primary: var(--color-border-brand-solid);
|
|
278
|
+
--color-bg-checkbox-checked-primary: var(--color-bg-brand-solid);
|
|
279
|
+
--color-text-checkbox-indicator-primary: #0d2d3a;
|
|
280
|
+
--color-text-checkbox-label-primary: var(--color-text-secondary-700);
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
--color-bg-progress-bar-track-primary: var(--color-bg-primary);
|
|
284
|
+
--color-bg-progress-bar-range-primary: var(--color-brand-400);
|
|
285
|
+
|
|
277
286
|
|
|
278
287
|
--color-bg-lock: #161B26;
|
|
279
288
|
--color-border-lock: #333741;
|