@opexa/portal-components 0.0.448 → 0.0.449

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 (99) hide show
  1. package/dist/components/Quests/JourneyQuest.js +21 -5
  2. package/dist/components/SignIn/FacebookSignInTrigger.d.ts +6 -1
  3. package/dist/components/SignIn/FacebookSignInTrigger.js +2 -2
  4. package/dist/components/SignIn/GoogleSignInTrigger.d.ts +2 -0
  5. package/dist/components/SignIn/GoogleSignInTrigger.js +2 -2
  6. package/dist/constants/EnvVar.d.ts +1 -1
  7. package/dist/types/index.d.ts +2 -1
  8. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  9. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  10. package/dist/ui/Badge/Badge.d.ts +12 -12
  11. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  12. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  13. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  14. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  15. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  16. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  17. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  18. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  19. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  20. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  21. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  22. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  23. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  24. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  25. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  26. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  27. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  28. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  29. package/dist/ui/Field/Field.d.ts +21 -21
  30. package/dist/ui/Field/field.recipe.d.ts +3 -3
  31. package/dist/ui/Menu/Menu.d.ts +144 -144
  32. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  33. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  34. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  35. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  36. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  37. package/dist/ui/PinInput/PinInput.d.ts +12 -12
  38. package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
  39. package/dist/ui/Popover/Popover.d.ts +55 -55
  40. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  41. package/dist/ui/Progress/Progress.d.ts +27 -27
  42. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  43. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  44. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  45. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  46. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  47. package/dist/ui/Select/Select.d.ts +45 -45
  48. package/dist/ui/Select/select.recipe.d.ts +3 -3
  49. package/dist/ui/Table/Table.d.ts +21 -21
  50. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  51. package/dist/ui/Table/table.recipe.d.ts +3 -3
  52. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  53. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  54. package/package.json +1 -1
  55. package/dist/components/Banner/Banner.client.d.ts +0 -12
  56. package/dist/components/Banner/Banner.client.js +0 -49
  57. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  58. package/dist/components/DigitainLauncher/Loading.js +0 -5
  59. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +0 -184
  60. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +0 -184
  61. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  62. package/dist/components/KYC/BasicInformation.js +0 -101
  63. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  64. package/dist/components/KYC/IdentityVerification.js +0 -120
  65. package/dist/components/KYC/Indicator.d.ts +0 -1
  66. package/dist/components/KYC/Indicator.js +0 -8
  67. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  68. package/dist/components/KYC/KYC.lazy.js +0 -45
  69. package/dist/components/KYC/KYCContext.d.ts +0 -6
  70. package/dist/components/KYC/KYCContext.js +0 -2
  71. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  72. package/dist/components/KYC/PersonalInformation.js +0 -122
  73. package/dist/components/KYC/useKYC.d.ts +0 -25
  74. package/dist/components/KYC/useKYC.js +0 -38
  75. package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +0 -1
  76. package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +0 -29
  77. package/dist/components/SessionWatcher/SessionWatcher.d.ts +0 -1
  78. package/dist/components/SessionWatcher/SessionWatcher.js +0 -20
  79. package/dist/components/SessionWatcher/index.d.ts +0 -1
  80. package/dist/components/SessionWatcher/index.js +0 -1
  81. package/dist/components/SignIn/utils.d.ts +0 -8
  82. package/dist/components/SignIn/utils.js +0 -26
  83. package/dist/constants/Branches.d.ts +0 -2
  84. package/dist/constants/Branches.js +0 -42
  85. package/dist/images/responsible-gaming-yellow.png +0 -0
  86. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  87. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  88. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  89. package/dist/third-parties/FacebookPixel/api.js +0 -1
  90. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  91. package/dist/third-parties/FacebookPixel/index.js +0 -1
  92. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  93. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  94. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  95. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  96. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  97. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  98. package/dist/third-parties/index.d.ts +0 -2
  99. package/dist/third-parties/index.js +0 -2
@@ -20,9 +20,17 @@ import { formatNumber } from '../../utils/formatNumber.js';
20
20
  import { getPercentage } from '../../utils/getPercentage.js';
21
21
  import { useQuestContext } from './QuestsContext.js';
22
22
  import { RemainingTime } from './RemainingTime.js';
23
+ import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
24
+ import { FacebookSignInTrigger } from '../SignIn/FacebookSignInTrigger.js';
25
+ import dynamic from 'next/dynamic';
26
+ const GoogleSignInButton = dynamic(() => import('../SignIn/GoogleSignInTrigger.js').then((m) => m.GoogleSignInTrigger), {
27
+ ssr: false,
28
+ loading: () => null,
29
+ });
23
30
  export function JourneyQuest() {
24
31
  const disclosure = useDisclosure();
25
32
  const quest = useQuestContext();
33
+ const featureFlag = useFeatureFlag();
26
34
  const { milestones, totalMilestones, currentMilestone, progressPercentage } = useMemo(() => {
27
35
  if (!quest?.milestones) {
28
36
  return {
@@ -32,7 +40,13 @@ export function JourneyQuest() {
32
40
  progressPercentage: 0,
33
41
  };
34
42
  }
35
- const transformedMilestones = quest.milestones.map((milestone) => ({
43
+ const filteredMilestones = quest.milestones.filter((milestone) => {
44
+ if (!featureFlag.enabled) {
45
+ return milestone.type !== 'LINK_FACEBOOK_ACCOUNT' && milestone.type !== 'LINK_GOOGLE_ACCOUNT';
46
+ }
47
+ return true;
48
+ });
49
+ const transformedMilestones = filteredMilestones.map((milestone) => ({
36
50
  key: milestone.type,
37
51
  label: milestone.name,
38
52
  bonus: milestone.bonusAmount
@@ -42,8 +56,8 @@ export function JourneyQuest() {
42
56
  id: milestone.id,
43
57
  description: milestone.description,
44
58
  }));
45
- const completedCount = quest.milestones.filter((m) => m.cleared).length;
46
- const total = quest.milestones.length;
59
+ const completedCount = filteredMilestones.filter((m) => m.cleared).length;
60
+ const total = filteredMilestones.length;
47
61
  return {
48
62
  milestones: transformedMilestones,
49
63
  totalMilestones: total,
@@ -85,7 +99,7 @@ function Rules(props) {
85
99
  return false;
86
100
  return milestones.every((milestone) => milestone.isCompleted);
87
101
  }, [milestones]);
88
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), 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 justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest?.name || 'Quest' }), _jsx("p", { children: quest?.description ||
102
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), 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 justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto min-h-auto min-w-[21.438rem] max-w-[400px] overflow-y-auto rounded-xl px-4 py-5 mt-40", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "group flex flex-col space-y-5 text-sm text-text-quarterary-brand", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest?.name || 'Quest' }), _jsx("p", { children: quest?.description ||
89
103
  'Ready for a challenge? Complete them all and get amazing rewards!' }), milestones.map((milestone) => (_jsxs("div", { className: "flex flex-col space-y-2.5 rounded-xl bg-bg-tertiary p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "font-medium text-base text-white", children: milestone.label }), milestone.isCompleted && (_jsx("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: "Complete" }))] }), milestone.description ? (_jsx(Prose, { dangerouslySetInnerHTML: {
90
104
  __html: milestone.description,
91
105
  } })) : milestone.bonus ? (_jsxs("p", { className: "ml-1", children: [milestone.key === 'REGISTRATION' &&
@@ -107,7 +121,9 @@ function Rules(props) {
107
121
  }
108
122
  }, "aria-label": `Complete ${milestone.label}`, children: [milestone.key === 'ACCOUNT_VERIFICATION' ? (_jsx(FileCheck02Icon, { className: "size-5" })) : (_jsx(CoinsHandIcon, { className: "size-5" })), milestone.key === 'FIRST_DEPOSIT'
109
123
  ? 'Deposit'
110
- : 'Verify Account'] }))] }, 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: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { children: ["Complete target to", ' ', _jsxs("span", { className: "text-brand-400", children: ["\u20B1", quest?.bonus] }), ' ', "bonus!"] }) })) }))] })] }) })] }) }));
124
+ : 'Verify Account'] })), !milestone.isCompleted &&
125
+ milestone.key === 'LINK_FACEBOOK_ACCOUNT' && (_jsx(FacebookSignInTrigger, { text: 'Link Facebook Account', className: 'items-center justify-center rounded-md font-semibold shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none h-10 gap-md px-3 text-sm flex w-full bg-button-primary-bg text-button-primary-fg' })), !milestone.isCompleted &&
126
+ milestone.key === 'LINK_GOOGLE_ACCOUNT' && (_jsx(GoogleSignInButton, { text: 'Link Google Account', className: 'items-center justify-center rounded-md font-semibold shadow-xs disabled:opacity-60 disabled:shadow-none aria-disabled:cursor-not-allowed aria-disabled:opacity-60 aria-disabled:shadow-none h-10 gap-md px-3 text-sm flex w-full bg-button-primary-bg text-button-primary-fg' }))] }, 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: "w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { children: ["Complete target to", ' ', _jsxs("span", { className: "text-brand-400", children: ["\u20B1", quest?.bonus] }), ' ', "bonus!"] }) })) }))] })] }) })] }) }));
111
127
  }
112
128
  function QuestMilestone({ label, bonus, isCompleted = false, }) {
113
129
  const localeInfo = useLocaleInfo();
@@ -1 +1,6 @@
1
- export declare const FacebookSignInTrigger: () => import("react/jsx-runtime").JSX.Element | null;
1
+ interface FacebookSignInTriggerProps {
2
+ text?: string;
3
+ className?: string;
4
+ }
5
+ export declare const FacebookSignInTrigger: (props: FacebookSignInTriggerProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -9,7 +9,7 @@ import { AUTH_ENDPOINT, PLATFORM_CODE } from '../../constants/index.js';
9
9
  import { FacebookIcon } from '../../icons/FacebookIcon.js';
10
10
  import { httpRequest } from '../../services/httpRequest.js';
11
11
  import { Button } from '../../ui/Button/index.js';
12
- export const FacebookSignInTrigger = () => {
12
+ export const FacebookSignInTrigger = (props) => {
13
13
  const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
14
14
  const signIn = useSignInMutation({
15
15
  onError: () => {
@@ -46,6 +46,6 @@ export const FacebookSignInTrigger = () => {
46
46
  description: 'Failed to sign in with Facebook. Please try again.',
47
47
  });
48
48
  }, render: ({ onClick }) => {
49
- return (_jsxs(Button, { variant: "outline", onClick: onClick, colorScheme: "gray", className: "mt-lg border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(FacebookIcon, { className: "size-6" }), "Continue with Facebook"] }));
49
+ return (_jsxs(Button, { variant: "outline", onClick: onClick, colorScheme: "gray", className: `mt-lg border-border-primary bg-bg-primary text-text-secondary-700 ${props.className}`, children: [_jsx(FacebookIcon, { className: "size-6" }), props.text ?? 'Continue with Facebook'] }));
50
50
  } }));
51
51
  };
@@ -1,5 +1,7 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
2
  export interface GoogleSignInTriggerProps extends ComponentPropsWithRef<'button'> {
3
3
  asChild?: boolean;
4
+ text?: string;
5
+ className?: string;
4
6
  }
5
7
  export declare const GoogleSignInTrigger: (props: GoogleSignInTriggerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -18,7 +18,7 @@ export const GoogleSignInTrigger = (props) => {
18
18
  return null;
19
19
  return (_jsx(GoogleOAuthProvider, { clientId: googleClientId, children: _jsx(Trigger, { ...props }) }));
20
20
  };
21
- const Trigger = ({ children, disabled, asChild, onClick, ...props }) => {
21
+ const Trigger = ({ children, disabled, asChild, onClick, text, className, ...props }) => {
22
22
  const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
23
23
  const signIn = useSignInMutation({
24
24
  onError: () => {
@@ -56,5 +56,5 @@ const Trigger = ({ children, disabled, asChild, onClick, ...props }) => {
56
56
  return (_jsx(ark.button, { type: "button", onClick: (e) => {
57
57
  onClick?.(e);
58
58
  signInGoogle();
59
- }, asChild: !children ? true : asChild, disabled: signIn.isPending || disabled, ...props, children: children ?? (_jsxs(Button, { variant: "outline", colorScheme: "gray", className: "bg-bg-primary", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] })) }));
59
+ }, asChild: !children ? true : asChild, disabled: signIn.isPending || disabled, ...props, children: children ?? (_jsxs(Button, { variant: "outline", colorScheme: "gray", className: `bg-bg-primary ${className}`, children: [_jsx(GoogleIcon, { className: "size-6" }), text ?? 'Continue with Google'] })) }));
60
60
  };
@@ -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: "development" | "production";
4
+ export declare const ENVIRONMENT: "production" | "development";
5
5
  export declare const INTERNALS__REPORT_WEB_VITALS: boolean;
@@ -703,7 +703,7 @@ export interface QuestProgram {
703
703
  description: string;
704
704
  }
705
705
  export type MemberStatus = 'ACTIVE' | 'BLACKLISTED' | 'SUSPENDED';
706
- export type JourneyQuestMilestoneType = 'REGISTRATION' | 'ACCOUNT_VERIFICATION' | 'FIRST_DEPOSIT' | 'IOS_FIRST_LOGIN' | 'ANDROID_FIRST_LOGIN' | 'CUSTOM';
706
+ export type JourneyQuestMilestoneType = 'REGISTRATION' | 'ACCOUNT_VERIFICATION' | 'FIRST_DEPOSIT' | 'IOS_FIRST_LOGIN' | 'ANDROID_FIRST_LOGIN' | 'LINK_FACEBOOK_ACCOUNT' | 'LINK_GOOGLE_ACCOUNT' | 'CUSTOM';
707
707
  export interface JourneyQuestMilestone {
708
708
  id: string;
709
709
  type: JourneyQuestMilestoneType;
@@ -735,6 +735,7 @@ export interface Quest {
735
735
  bonusAmount?: string;
736
736
  firstDepositCompleted?: boolean;
737
737
  accountVerificationCompleted?: boolean;
738
+ milestones?: JourneyQuestMilestone[];
738
739
  }
739
740
  interface TopWinGame {
740
741
  id: string;