@opexa/portal-components 0.0.153 → 0.0.155

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 (70) hide show
  1. package/dist/components/AccountVerification/AccountVerification.js +1 -5
  2. package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +8 -1
  3. package/dist/components/KYC/AutoOpen.d.ts +1 -0
  4. package/dist/components/KYC/AutoOpen.js +25 -0
  5. package/dist/components/KYC/BasicInformation.js +6 -4
  6. package/dist/components/KYC/FileUpload.js +29 -3
  7. package/dist/components/KYC/KYC.js +2 -1
  8. package/dist/components/KYC/KYC.lazy.js +3 -26
  9. package/dist/components/KYC/useKYC.d.ts +1 -0
  10. package/dist/components/KYC/useKYC.js +8 -0
  11. package/dist/components/Messages/Message.js +8 -10
  12. package/dist/components/Messages/MessageContext.d.ts +1 -1
  13. package/dist/components/Messages/MessageContext.js +1 -1
  14. package/dist/components/Messages/MessagePopup.d.ts +1 -1
  15. package/dist/components/Messages/MessagePopup.js +7 -11
  16. package/dist/components/Messages/MessagesPopup.js +10 -2
  17. package/dist/components/Quests/CountdownTimer.d.ts +15 -0
  18. package/dist/components/Quests/CountdownTimer.js +33 -0
  19. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
  20. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +78 -0
  21. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
  22. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
  23. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
  24. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
  25. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
  26. package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
  27. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
  28. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
  29. package/dist/components/SignUp/SignUpForm.js +0 -4
  30. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  31. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  32. package/dist/ui/Badge/Badge.d.ts +12 -12
  33. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  34. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  35. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  36. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  37. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  38. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  39. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  40. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  41. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  42. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  43. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  44. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  45. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  46. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  47. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  48. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  49. package/dist/ui/Menu/Menu.d.ts +90 -90
  50. package/dist/ui/Menu/menu.recipe.d.ts +5 -5
  51. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  52. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  53. package/dist/ui/Progress/Progress.d.ts +27 -27
  54. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  55. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  56. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  57. package/dist/ui/Select/Select.d.ts +45 -45
  58. package/dist/ui/Select/select.recipe.d.ts +3 -3
  59. package/dist/ui/Table/Table.d.ts +21 -21
  60. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  61. package/dist/ui/Table/table.recipe.d.ts +3 -3
  62. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  63. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  64. package/dist/ui/Tooltip/Tooltip.d.ts +30 -30
  65. package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
  66. package/dist/utils/dataUrlToBlob.d.ts +1 -0
  67. package/dist/utils/dataUrlToBlob.js +11 -0
  68. package/dist/utils/resizeImageSize.d.ts +2 -0
  69. package/dist/utils/resizeImageSize.js +11 -0
  70. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { ClockStopWatchIcon } from '../../../icons/ClockStopWatchIcon.js';
6
+ import { InfoCircleIcon } from '../../../icons/InfoCircleIcon.js';
7
+ import { Badge } from '../../../ui/Badge/index.js';
8
+ import CountdownTimer from '../CountdownTimer.js';
9
+ import { WageringQuestModal } from './WageringQuestModal.js';
10
+ export function WageringQuest({ quest }) {
11
+ const [showRules, setShowRules] = useState(false);
12
+ const [isExpired, setIsExpired] = useState(false);
13
+ const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
14
+ return (_jsxs(_Fragment, { children: [_jsx(WageringQuestModal, { questName: name, modalState: {
15
+ isOpen: showRules,
16
+ setIsOpen: setShowRules,
17
+ } }), _jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(CountdownTimer, { endDateTime: endDateTime, renderAction: (timeLeft) => (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsxs(Badge.Label, { children: [timeLeft.days, "d:", timeLeft.hours, "h:", timeLeft.minutes, "m:", timeLeft.seconds, "s"] })] })), onEnd: () => setIsExpired(true) }), _jsx("div", { role: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => setShowRules((prev) => !prev), children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseInt(progressPercentage).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " PHP"] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(isExpired || status === 'COMPLETED' || status === 'FAILED'
18
+ ? ['opacity-50 grayscale']
19
+ : ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] })] }));
20
+ }
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ questName: string;
3
+ modalState: {
4
+ isOpen: boolean;
5
+ setIsOpen: (isOpen: boolean) => void;
6
+ };
7
+ }
8
+ export declare function WageringQuestModal(props: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { XIcon } from '../../../icons/XIcon.js';
4
+ import { Button } from '../../../ui/Button/index.js';
5
+ import { Dialog } from '../../../ui/Dialog/index.js';
6
+ import { Portal } from '../../../ui/Portal/index.js';
7
+ export function WageringQuestModal(props) {
8
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: props.modalState.isOpen, onOpenChange: ({ open }) => props.modalState.setIsOpen(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: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("p", { className: "text-text-primary-900 text-lg font-semibold", children: props.questName }), _jsxs("ul", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => props.modalState.setIsOpen(false), children: "Ok" }) })] }) })] }) }));
9
+ }
@@ -46,9 +46,6 @@ export function SignUpForm() {
46
46
  itemToValue: (item) => item.code,
47
47
  itemToString: (item) => `${item.code} - ${item.name}`,
48
48
  });
49
- const globalStore = useGlobalStore(useShallow((ctx) => ({
50
- kyc: ctx.kyc,
51
- })));
52
49
  const [step, setStep] = useState(1);
53
50
  const dialog = useDialogContext();
54
51
  const search = useSearchParams();
@@ -242,7 +239,6 @@ export function SignUpForm() {
242
239
  dialog.setOpen(false);
243
240
  step1Form.reset();
244
241
  step2Form.reset();
245
- globalStore.kyc.setOpen(true);
246
242
  setStep(1);
247
243
  }
248
244
  catch (error) {