@opexa/portal-components 0.0.597 → 0.0.599

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.
@@ -53,6 +53,8 @@ export interface TermsOfUseStore extends TermsAndConditionsStore {
53
53
  }
54
54
  export interface ResponsibleGamingStore extends TermsAndConditionsStore {
55
55
  }
56
+ export interface OnboardingStore extends TermsAndConditionsStore {
57
+ }
56
58
  export interface ResponsibleGamingReminderStore extends PopupStore {
57
59
  }
58
60
  export interface HasPendingBonusStore {
@@ -82,6 +84,7 @@ export interface GlobalStore {
82
84
  termsAndConditions: TermsAndConditionsStore;
83
85
  termsOfUse: TermsOfUseStore;
84
86
  responsibleGaming: ResponsibleGamingStore;
87
+ onboarding: OnboardingStore;
85
88
  responsibleGamingReminder: ResponsibleGamingReminderStore;
86
89
  pendingBonus: HasPendingBonusStore;
87
90
  }
@@ -372,6 +372,39 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
372
372
  },
373
373
  '~touched': false,
374
374
  },
375
+ onboarding: {
376
+ open: false,
377
+ setOpen(open) {
378
+ set((prev) => ({
379
+ onboarding: {
380
+ ...prev.onboarding,
381
+ open,
382
+ '~touched': true,
383
+ },
384
+ }));
385
+ },
386
+ next: null,
387
+ setNext(next) {
388
+ set((prev) => ({
389
+ onboarding: {
390
+ ...prev.onboarding,
391
+ next,
392
+ '~touched': true,
393
+ },
394
+ }));
395
+ },
396
+ accepted: false,
397
+ setAccepted(accepted) {
398
+ set((prev) => ({
399
+ onboarding: {
400
+ ...prev.onboarding,
401
+ accepted,
402
+ '~touched': true,
403
+ },
404
+ }));
405
+ },
406
+ '~touched': false,
407
+ },
375
408
  responsibleGamingReminder: {
376
409
  open: false,
377
410
  setOpen(open) {
@@ -6,5 +6,6 @@ export interface DisclaimerV3Props {
6
6
  responsibleGamingLogo?: ImageProps['src'];
7
7
  pagcorLogo?: ImageProps['src'];
8
8
  redirectUrlOnNoConsent?: string;
9
+ openOnboardingOnAgree?: boolean;
9
10
  }
10
11
  export declare function DisclaimerV3(props: DisclaimerV3Props): import("react/jsx-runtime").JSX.Element;
@@ -17,6 +17,7 @@ export function DisclaimerV3(props) {
17
17
  const globalStore = useGlobalStore(useShallow((ctx) => ({
18
18
  termsOfUse: ctx.termsOfUse,
19
19
  responsibleGaming: ctx.responsibleGaming,
20
+ onboarding: ctx.onboarding,
20
21
  })));
21
22
  const checked = (globalStore.termsOfUse.accepted &&
22
23
  globalStore.responsibleGaming.accepted) ||
@@ -37,6 +38,9 @@ export function DisclaimerV3(props) {
37
38
  return;
38
39
  }
39
40
  disclaimer.close();
41
+ if (props.openOnboardingOnAgree) {
42
+ globalStore.onboarding.setOpen(true);
43
+ }
40
44
  }, children: "I Agree" }), _jsx(Button, { type: "button", onClick: () => {
41
45
  if (props.redirectUrlOnNoConsent) {
42
46
  window.location.href = props.redirectUrlOnNoConsent;
@@ -49,7 +49,8 @@ export function KYCReminder(props) {
49
49
  const isAccountReady = !accountLoading;
50
50
  const isKYCReminderOpen = globalStore.kycReminder.open && !globalStore.kyc.open;
51
51
  const isResponsibleGamingReminderClosed = !globalStore.responsibleGamingReminder.open;
52
- const isKYCStateRelevant = isNotVerified || ((isPending || isVerificationLocked) && featureFlag.enabled);
52
+ const isKYCStateRelevant = isNotVerified ||
53
+ ((isPending || isVerificationLocked) && featureFlag.enabled);
53
54
  return (_jsx(Dialog.Root, { open: isSessionReady &&
54
55
  isAccountReady &&
55
56
  isKYCReminderOpen &&
@@ -71,13 +72,14 @@ export function KYCReminder(props) {
71
72
  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: () => {
72
73
  api.setOpen(false);
73
74
  globalStore.kyc.setOpen(true);
74
- }, children: "Complete KYC" }) })) })] })] })), isNotVerified && (!isVerificationLocked || !featureFlag.enabled) && (_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: () => {
75
+ }, children: "Complete KYC" }) })) })] })] })), isNotVerified &&
76
+ (!isVerificationLocked || !featureFlag.enabled) && (_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: () => {
75
77
  api.setOpen(false);
76
78
  globalStore.kyc.setOpen(true);
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: () => {
78
- signOutMutation.mutate();
79
- globalStore.account.setOpen(false);
80
- globalStore.account__mobile.setOpen(false);
81
- router.push('/');
82
- }, children: "Log Out" }) })) })] }))] }) })] }) }));
79
+ }, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })), isPending && isVerificationLocked && 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("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
80
+ signOutMutation.mutate();
81
+ globalStore.account.setOpen(false);
82
+ globalStore.account__mobile.setOpen(false);
83
+ router.push('/');
84
+ }, children: "Log Out" }) })] }))] }) })] }) }));
83
85
  }
@@ -0,0 +1 @@
1
+ export declare function Onboarding(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import dynamic from 'next/dynamic';
4
+ import { useShallow } from 'zustand/shallow';
5
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
+ const OnboardingV1 = dynamic(() => import('./OnboardingV1.lazy.js').then((m) => m.Onboarding), {
7
+ ssr: false,
8
+ loading: () => null,
9
+ });
10
+ export function Onboarding() {
11
+ const touched = useGlobalStore(useShallow((ctx) => ctx.onboarding['~touched']));
12
+ if (!touched) {
13
+ return null;
14
+ }
15
+ return _jsx(OnboardingV1, {});
16
+ }
@@ -0,0 +1 @@
1
+ export declare function Onboarding(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,127 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ import { useEffect, useState } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { useShallow } from 'zustand/shallow';
6
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
7
+ import firstStepBackground from '../../images/first-step-background.png';
8
+ import fourthStepBackground from '../../images/fourth-step-background.png';
9
+ import secondStepBackground from '../../images/second-step-background.png';
10
+ import thirdStepBackground from '../../images/third-step-background.png';
11
+ import { Dialog } from '../../ui/Dialog/index.js';
12
+ import { Portal } from '../../ui/Portal/index.js';
13
+ const AnimatedHeader = ({ text }) => {
14
+ if (text === '88PLAY') {
15
+ return (_jsx("div", { className: "relative", children: _jsxs("h1", { className: "venus-rising flex items-center font-bold text-4xl drop-shadow-lg", children: [_jsx("span", { className: "text-transparent", style: {
16
+ backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
17
+ backgroundSize: '300% 100%',
18
+ animation: 'gradient 8s linear infinite',
19
+ backgroundClip: 'text',
20
+ WebkitBackgroundClip: 'text',
21
+ }, children: "88" }), _jsx("span", { className: "ml-2 text-white", children: "PLAY" })] }) }));
22
+ }
23
+ if (text === 'Secured Transactions') {
24
+ return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "venus-rising text-center font-bold drop-shadow-lg", children: [_jsx("div", { className: "text-4xl text-transparent", style: {
25
+ backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
26
+ backgroundSize: '300% 100%',
27
+ animation: 'gradient 8s linear infinite',
28
+ backgroundClip: 'text',
29
+ WebkitBackgroundClip: 'text',
30
+ }, children: "SECURED" }), _jsx("div", { className: "text-3xl text-transparent", style: {
31
+ backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
32
+ backgroundSize: '300% 100%',
33
+ animation: 'gradient 8s linear infinite',
34
+ backgroundClip: 'text',
35
+ WebkitBackgroundClip: 'text',
36
+ }, children: "TRANSACTIONS" })] }) }));
37
+ }
38
+ return (_jsx("div", { className: "relative", children: _jsx("h1", { className: "venus-rising font-bold text-4xl text-transparent drop-shadow-lg", style: {
39
+ backgroundImage: 'linear-gradient(to right, #B59440, #6A4C1A, #BD9B4D, #6A4C1A, #B99D47)',
40
+ backgroundSize: '300% 100%',
41
+ animation: 'gradient 8s linear infinite',
42
+ backgroundClip: 'text',
43
+ WebkitBackgroundClip: 'text',
44
+ }, children: text }) }));
45
+ };
46
+ const carouselData = [
47
+ {
48
+ background: firstStepBackground,
49
+ headerText: '88PLAY',
50
+ description: 'Welcome to 88Play! your trusted PAGCOR-licensed online casino where every player is treated like a VIP and the fun never stops!',
51
+ },
52
+ {
53
+ background: secondStepBackground,
54
+ headerText: 'NEW GAMES',
55
+ description: 'Discover our latest casino titles, bringing you fresh excitement and more ways to win every time you play.',
56
+ },
57
+ {
58
+ background: thirdStepBackground,
59
+ headerText: 'Secured Transactions',
60
+ description: 'Enjoy fast, secure, and hassle-free deposits and withdrawals with trusted local payment options.',
61
+ },
62
+ {
63
+ background: fourthStepBackground,
64
+ headerText: 'Bonuses',
65
+ description: 'Unlock exciting rewards and exclusive promotions designed to boost your gaming experience.',
66
+ },
67
+ ];
68
+ const CardStepper = ({ data }) => {
69
+ return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: "h-auto w-full", children: _jsx(Image, { src: data.background, alt: "Step Background", className: "h-auto w-full object-cover" }) }), _jsx("div", { className: "mt-4 flex h-auto w-full items-center justify-center", children: _jsx(AnimatedHeader, { text: data.headerText }) }), _jsx("div", { className: "mt-4 px-5 text-center text-sm text-white/50", children: data.description })] }));
70
+ };
71
+ const OnboardingCarousel = () => {
72
+ const [currentStep, setCurrentStep] = useState(0);
73
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
74
+ onboarding: ctx.onboarding,
75
+ })));
76
+ const nextStep = () => {
77
+ setCurrentStep((prev) => (prev + 1) % carouselData.length);
78
+ };
79
+ const goToStep = (step) => {
80
+ setCurrentStep(step);
81
+ };
82
+ const handleContinue = () => {
83
+ if (currentStep === carouselData.length - 1) {
84
+ // Last step - close dialog
85
+ globalStore.onboarding.setOpen(false);
86
+ }
87
+ else {
88
+ // Not last step - go to next
89
+ nextStep();
90
+ }
91
+ };
92
+ const handleSkip = () => {
93
+ // Skip always closes dialog
94
+ globalStore.onboarding.setOpen(false);
95
+ };
96
+ useEffect(() => {
97
+ const interval = setInterval(() => {
98
+ setCurrentStep((prev) => (prev + 1) % carouselData.length);
99
+ }, 5000);
100
+ return () => clearInterval(interval);
101
+ }, []);
102
+ return (_jsxs("div", { className: "mb-5 w-full", children: [_jsx("div", { className: "relative overflow-hidden", children: _jsx("div", { className: "flex transition-transform duration-300 ease-in-out", style: { transform: `translateX(-${currentStep * 100}%)` }, children: carouselData.map((stepData, index) => (_jsx("div", { className: "w-full flex-shrink-0", children: _jsx(CardStepper, { data: stepData }) }, index))) }) }), _jsx("div", { className: "mt-4 flex justify-center px-5", children: _jsx("div", { className: "flex space-x-2", children: carouselData.map((_, index) => (_jsx("button", { type: "button", onClick: () => goToStep(index), className: twMerge('h-2 rounded-full transition-all duration-300', index === currentStep ? 'w-5 bg-yellow-400' : 'w-2 bg-white/30'), "aria-label": `Go to step ${index + 1}` }, index))) }) }), _jsxs("div", { className: "mt-6 flex gap-3 px-5", children: [_jsx("button", { type: "button", onClick: handleSkip, className: "flex-1 rounded-lg border border-yellow-400/50 bg-transparent py-3 font-medium text-sm text-yellow-400 hover:bg-yellow-400/10", children: "Skip" }), _jsx("button", { type: "button", onClick: handleContinue, className: "flex-1 rounded-lg bg-yellow-400 py-3 font-medium text-black text-sm hover:bg-yellow-500", children: currentStep === carouselData.length - 1 ? 'Play Now' : 'Continue' })] })] }));
103
+ };
104
+ export function Onboarding() {
105
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
106
+ signIn: ctx.signIn,
107
+ signUp: ctx.signUp,
108
+ disclaimer: ctx.disclaimer,
109
+ onboarding: ctx.onboarding,
110
+ })));
111
+ return (_jsx(Dialog.Root, { open: globalStore.onboarding.open, onOpenChange: (details) => {
112
+ globalStore.onboarding.setOpen(details.open);
113
+ if (!details.open)
114
+ globalStore.onboarding.setAccepted(true);
115
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
116
+ if (globalStore.onboarding.next === 'SIGN_IN') {
117
+ globalStore.signIn.setOpen(true);
118
+ }
119
+ if (globalStore.onboarding.next === 'SIGN_UP') {
120
+ globalStore.signUp.setOpen(true);
121
+ }
122
+ if (globalStore.onboarding.next === 'DISCLAIMER') {
123
+ globalStore.disclaimer.setOpen(true);
124
+ }
125
+ globalStore.onboarding.setNext(null);
126
+ }, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsx(Dialog.Content, { className: twMerge('flex h-full w-full flex-col items-start overflow-y-auto lg:mx-auto lg:h-auto lg:max-h-[80vh] lg:w-[400px]', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent'), children: _jsx(OnboardingCarousel, {}) }) })] }) }));
127
+ }
@@ -0,0 +1 @@
1
+ export * from './Onboarding';
@@ -0,0 +1 @@
1
+ export * from './Onboarding.js';
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.597",
3
+ "version": "0.0.599",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",