@opexa/portal-components 0.0.16 → 0.0.18
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/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/useGlobalStore.d.ts +11 -1
- package/dist/client/hooks/useGlobalStore.js +1 -1
- package/dist/client/hooks/useGlobalStore.mjs +81 -35
- package/dist/client/hooks/useMarkMessageAsReadMutation.d.ts +6 -0
- package/dist/client/hooks/useMarkMessageAsReadMutation.js +1 -0
- package/dist/client/hooks/useMarkMessageAsReadMutation.mjs +39 -0
- package/dist/client/hooks/useMessagesQuery.d.ts +3 -0
- package/dist/client/hooks/useMessagesQuery.js +1 -0
- package/dist/client/hooks/useMessagesQuery.mjs +47 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.d.ts +3 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +1 -0
- package/dist/client/hooks/useUnreadMessagesCountQuery.mjs +38 -0
- package/dist/client-hooks.js +1 -1
- package/dist/client-hooks.mjs +38 -32
- package/dist/components/Account/Account.d.ts +3 -1
- package/dist/components/Account/Account.js +1 -1
- package/dist/components/Account/Account.mjs +163 -96
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/Banner/Banner.mjs +6 -6
- package/dist/components/BetRecords/BetRecords.js +1 -1
- package/dist/components/BetRecords/BetRecords.mjs +357 -325
- package/dist/components/Bonus/Bonus.client.d.ts +2 -0
- package/dist/components/Bonus/Bonus.d.ts +10 -0
- package/dist/components/Bonus/index.d.ts +1 -0
- package/dist/components/Bonuses/Bonuses.d.ts +15 -0
- package/dist/components/Bonuses/Bonuses.js +1 -0
- package/dist/components/Bonuses/Bonuses.mjs +125 -0
- package/dist/components/Bonuses/index.d.ts +1 -0
- package/dist/components/DepositWithdrawal/AmountChoices.js +1 -1
- package/dist/components/DepositWithdrawal/AmountChoices.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.mjs +11 -8
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.mjs +16 -13
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.mjs +5 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositVCA.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.mjs +18 -15
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositQrCode.mjs +9 -6
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositSuccess.mjs +9 -6
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.mjs +46 -46
- package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.mjs +26 -23
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.mjs +86 -76
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.mjs +118 -108
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.mjs +75 -65
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.mjs +96 -86
- package/dist/components/Disclaimer/Disclaimer.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.mjs +11 -8
- package/dist/components/Empty/Empty.js +1 -1
- package/dist/components/Empty/Empty.mjs +14 -10
- package/dist/components/GameLaunch/GameLaunch.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.mjs +42 -39
- package/dist/components/Games/Games.client.js +1 -1
- package/dist/components/Games/Games.client.mjs +47 -44
- package/dist/components/Games/Games.d.ts +7 -2
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +4 -2
- package/dist/components/JackpotCounter/JackpotCounter.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounter.mjs +38 -34
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +3 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.mjs +282 -124
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css.js +1 -1
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css.mjs +11 -8
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +1 -0
- package/dist/components/Jackpots/JackpotItem.d.ts +7 -0
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +7 -0
- package/dist/components/Jackpots/Jackpots.d.ts +8 -0
- package/dist/components/Jackpots/index.d.ts +1 -0
- package/dist/components/Marquee/Marquee.js +1 -1
- package/dist/components/Marquee/Marquee.mjs +12 -14
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +1 -0
- package/dist/components/Messages/MessageItem.mjs +66 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +1 -0
- package/dist/components/Messages/MessagePopup.mjs +89 -0
- package/dist/components/Messages/Messages.d.ts +1 -0
- package/dist/components/Messages/Messages.js +1 -0
- package/dist/components/Messages/Messages.mjs +147 -0
- package/dist/components/Messages/index.d.ts +1 -0
- package/dist/components/Messages/utils.d.ts +3 -0
- package/dist/components/Messages/utils.js +1 -0
- package/dist/components/Messages/utils.mjs +16 -0
- package/dist/components/Promos/PromoCarousel.js +1 -1
- package/dist/components/Promos/PromoCarousel.mjs +27 -24
- package/dist/components/Promos/PromoGrid.js +1 -1
- package/dist/components/Promos/PromoGrid.mjs +7 -7
- package/dist/components/Promos/PromoItem.js +1 -1
- package/dist/components/Promos/PromoItem.mjs +10 -7
- package/dist/components/Promos/Promos.d.ts +4 -2
- package/dist/components/SignIn/SignIn.d.ts +0 -1
- package/dist/components/SignIn/SignIn.js +1 -1
- package/dist/components/SignIn/SignIn.mjs +32 -41
- package/dist/components/SignIn/SignInForm.js +1 -1
- package/dist/components/SignIn/SignInForm.mjs +167 -160
- package/dist/components/SignUp/SignUp.d.ts +0 -1
- package/dist/components/SignUp/SignUp.js +1 -1
- package/dist/components/SignUp/SignUp.mjs +32 -41
- package/dist/components/SignUp/SignUpForm.js +1 -1
- package/dist/components/SignUp/SignUpForm.mjs +123 -116
- package/dist/components/TopWins/TopWins.client.js +1 -1
- package/dist/components/TopWins/TopWins.client.mjs +14 -14
- package/dist/components/TopWins/TopWins.d.ts +2 -1
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +4 -2
- package/dist/components/TournamentCounter/TournamentCounter.js +1 -1
- package/dist/components/TournamentCounter/TournamentCounter.mjs +27 -24
- package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.mjs +113 -99
- package/dist/components/TransactionRecords/TableFilters.d.ts +3 -1
- package/dist/components/TransactionRecords/TableFilters.js +1 -1
- package/dist/components/TransactionRecords/TableFilters.mjs +193 -132
- package/dist/components/TransactionRecords/TransactionRecords.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.mjs +21 -17
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.mjs +89 -77
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -1
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.mjs +105 -96
- package/dist/components/index.d.ts +2 -0
- package/dist/components.js +1 -1
- package/dist/components.mjs +36 -32
- package/dist/icons/ArrowNarrowDownIcon.d.ts +2 -0
- package/dist/icons/ArrowNarrowUpIcon.d.ts +2 -0
- package/dist/icons/Bell01Icon.d.ts +2 -0
- package/dist/icons/Bell01Icon.js +1 -0
- package/dist/icons/Bell01Icon.mjs +27 -0
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +1 -0
- package/dist/icons/BellRingIcon.mjs +27 -0
- package/dist/icons/EyeIcon.d.ts +2 -0
- package/dist/icons/EyeIcon.js +1 -0
- package/dist/icons/EyeIcon.mjs +25 -0
- package/dist/icons/EyeOffIcon.d.ts +2 -0
- package/dist/icons/EyeOffIcon.js +1 -0
- package/dist/icons/EyeOffIcon.mjs +22 -0
- package/dist/icons/StarIcon.d.ts +2 -0
- package/dist/icons/StarIcon.js +1 -0
- package/dist/icons/StarIcon.mjs +19 -0
- package/dist/icons/StopWatchIcon.d.ts +2 -0
- package/dist/icons/StopWatchIcon.js +1 -0
- package/dist/icons/StopWatchIcon.mjs +22 -0
- package/dist/icons/Trophy01Icon.d.ts +2 -0
- package/dist/icons/Trophy01Icon.js +1 -0
- package/dist/icons/Trophy01Icon.mjs +22 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +1 -0
- package/dist/icons.mjs +62 -0
- package/dist/images/first-place.png.js +1 -0
- package/dist/images/first-place.png.mjs +4 -0
- package/dist/images/leaderboard.png.js +1 -0
- package/dist/images/leaderboard.png.mjs +4 -0
- package/dist/images/placeholder-avatar.png.js +1 -0
- package/dist/images/placeholder-avatar.png.mjs +4 -0
- package/dist/images/responsible-gaming.png.js +1 -1
- package/dist/images/responsible-gaming.png.mjs +2 -2
- package/dist/portal-components.css +1 -1
- package/dist/server/utils/prefetchUnreadMessagesCountQuery.d.ts +2 -0
- package/dist/theme.css +130 -4
- package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.mjs +6 -6
- package/dist/ui/Badge/Badge.d.ts +274 -27
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Badge/Badge.mjs +14 -10
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.anatomy.js +1 -1
- package/dist/ui/Badge/badge.anatomy.mjs +1 -0
- package/dist/ui/Badge/badge.recipe.d.ts +57 -9
- package/dist/ui/Badge/badge.recipe.js +1 -1
- package/dist/ui/Badge/badge.recipe.mjs +57 -21
- package/dist/ui/Button/button.recipe.d.ts +2 -2
- package/dist/ui/Button/button.recipe.js +1 -1
- package/dist/ui/Button/button.recipe.mjs +17 -7
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Checkbox/checkbox.recipe.mjs +6 -6
- package/dist/ui/Collapsible/Collapsible.d.ts +114 -0
- package/dist/ui/Collapsible/Collapsible.js +1 -0
- package/dist/ui/Collapsible/Collapsible.mjs +13 -0
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +28 -0
- package/dist/ui/Collapsible/collapsible.recipe.js +1 -0
- package/dist/ui/Collapsible/collapsible.recipe.mjs +18 -0
- package/dist/ui/Collapsible/index.d.ts +1 -0
- package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
- package/dist/ui/DatePicker/datePicker.recipe.mjs +37 -6
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Dialog/dialog.recipe.mjs +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +1 -1
- package/dist/ui/Drawer/drawer.recipe.mjs +6 -6
- package/dist/ui/Field/field.recipe.js +1 -1
- package/dist/ui/Field/field.recipe.mjs +10 -12
- package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
- package/dist/ui/IconButton/iconButton.recipe.js +1 -1
- package/dist/ui/IconButton/iconButton.recipe.mjs +6 -6
- package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
- package/dist/ui/NumberInput/numberInput.recipe.mjs +8 -8
- package/dist/ui/PasswordInput/PasswordInput.d.ts +242 -1
- package/dist/ui/PasswordInput/PasswordInput.js +1 -0
- package/dist/ui/PasswordInput/PasswordInput.mjs +18 -0
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +6 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -0
- package/dist/ui/PasswordInput/passwordInput.recipe.mjs +48 -0
- package/dist/ui/PinInput/pinInput.recipe.js +1 -1
- package/dist/ui/PinInput/pinInput.recipe.mjs +3 -3
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Popover/popover.recipe.mjs +1 -1
- package/dist/ui/Progress/Progress.d.ts +335 -1
- package/dist/ui/Progress/Progress.js +1 -1
- package/dist/ui/Progress/Progress.mjs +15 -2
- package/dist/ui/Progress/progress.recipe.d.ts +37 -1
- package/dist/ui/Progress/progress.recipe.js +1 -0
- package/dist/ui/Progress/progress.recipe.mjs +41 -0
- package/dist/ui/Prose.d.ts +2 -0
- package/dist/ui/Prose.js +1 -0
- package/dist/ui/Prose.mjs +47 -0
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- package/dist/ui/SegmentGroup/segmentGroup.recipe.mjs +3 -3
- package/dist/ui/Select/select.recipe.js +1 -1
- package/dist/ui/Select/select.recipe.mjs +6 -6
- package/dist/ui/Table/table.recipe.js +1 -1
- package/dist/ui/Table/table.recipe.mjs +4 -4
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/ui/Tabs/tabs.recipe.mjs +3 -3
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +36 -30
- package/dist/utils/queryKeys.d.ts +4 -1
- package/dist/utils/queryKeys.js +1 -1
- package/dist/utils/queryKeys.mjs +34 -26
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +35 -32
- package/package.json +11 -5
- package/dist/components/Promos/PromosContent.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import m from "next/image";
|
|
3
3
|
import { useRouter as l } from "next/navigation";
|
|
4
4
|
import { twJoin as p } from "tailwind-merge";
|
|
@@ -8,6 +8,7 @@ import "../../ui/Badge/Badge.mjs";
|
|
|
8
8
|
import { Button as n } from "../../ui/Button/Button.mjs";
|
|
9
9
|
import "../../ui/Checkbox/Checkbox.mjs";
|
|
10
10
|
import "../../ui/Clipboard/Clipboard.mjs";
|
|
11
|
+
import "../../ui/Collapsible/Collapsible.mjs";
|
|
11
12
|
import "../../ui/DatePicker/DatePicker.mjs";
|
|
12
13
|
import "../../ui/Dialog/Dialog.mjs";
|
|
13
14
|
import "../../ui/Drawer/Drawer.mjs";
|
|
@@ -21,15 +22,17 @@ import "../../utils/getQueryClient.mjs";
|
|
|
21
22
|
import "../../utils/isMobile.mjs";
|
|
22
23
|
import "../../ui/IconButton/iconButton.recipe.mjs";
|
|
23
24
|
import "../../ui/NumberInput/NumberInput.mjs";
|
|
25
|
+
import "../../ui/PasswordInput/PasswordInput.mjs";
|
|
24
26
|
import "../../ui/PinInput/PinInput.mjs";
|
|
25
27
|
import "../../ui/Popover/Popover.mjs";
|
|
28
|
+
import "../../ui/Progress/Progress.mjs";
|
|
26
29
|
import "../../ui/SegmentGroup/SegmentGroup.mjs";
|
|
27
30
|
import "../../ui/Select/Select.mjs";
|
|
28
31
|
import "../../ui/Table/Table.mjs";
|
|
29
32
|
import "../../ui/Tabs/Tabs.mjs";
|
|
30
|
-
function
|
|
31
|
-
const { promo: t } = o,
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
function A(o) {
|
|
34
|
+
const { promo: t } = o, e = l();
|
|
35
|
+
return /* @__PURE__ */ i(
|
|
33
36
|
"div",
|
|
34
37
|
{
|
|
35
38
|
className: "border-gray-50 bg-accent-50 relative flex h-full flex-col rounded-md border",
|
|
@@ -45,7 +48,7 @@ function $(o) {
|
|
|
45
48
|
className: "aspect-[1200/500] w-full rounded-t-md object-cover"
|
|
46
49
|
}
|
|
47
50
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ i("div", { className: "flex flex-grow flex-col p-4", children: [
|
|
49
52
|
/* @__PURE__ */ r(
|
|
50
53
|
"p",
|
|
51
54
|
{
|
|
@@ -68,7 +71,7 @@ function $(o) {
|
|
|
68
71
|
{
|
|
69
72
|
className: "w-full",
|
|
70
73
|
variant: "outline",
|
|
71
|
-
onClick: () =>
|
|
74
|
+
onClick: () => e.push(`/promos/${t.id}`),
|
|
72
75
|
children: "Read More"
|
|
73
76
|
}
|
|
74
77
|
) })
|
|
@@ -79,5 +82,5 @@ function $(o) {
|
|
|
79
82
|
);
|
|
80
83
|
}
|
|
81
84
|
export {
|
|
82
|
-
|
|
85
|
+
A as PromosItem
|
|
83
86
|
};
|
|
@@ -2,7 +2,6 @@ import { ImageProps } from 'next/image';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export interface SignInProps {
|
|
4
4
|
logo: ImageProps['src'];
|
|
5
|
-
banner: ImageProps['src'];
|
|
6
5
|
children?: ReactNode;
|
|
7
6
|
}
|
|
8
7
|
export declare function SignIn(props: SignInProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@ark-ui/react"),o=require("next/image"),s=require("zustand/shallow");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");require("../../utils/parseDecimal.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");require("react");require("lodash-es");require("@opexa/portal-sdk-core/object-id");const l=require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");require("usehooks-ts");const q=require("../../icons/XIcon.js");require("../../ui/AlertDialog/AlertDialog.js");require("../../ui/Avatar/Avatar.js");require("../../ui/Badge/Badge.js");require("../../ui/Button/button.recipe.js");require("../../ui/Checkbox/Checkbox.js");require("../../ui/Clipboard/Clipboard.js");require("../../ui/Collapsible/Collapsible.js");require("../../ui/DatePicker/DatePicker.js");const r=require("../../ui/Dialog/Dialog.js");require("../../ui/Drawer/Drawer.js");require("../../ui/Field/Field.js");require("../../ui/IconButton/iconButton.recipe.js");require("../../ui/NumberInput/NumberInput.js");require("../../ui/PasswordInput/PasswordInput.js");require("../../ui/PinInput/PinInput.js");require("../../ui/Popover/Popover.js");require("tailwind-merge");require("../../ui/Progress/Progress.js");require("../../ui/SegmentGroup/SegmentGroup.js");require("../../ui/Select/Select.js");require("../../ui/Table/Table.js");require("../../ui/Tabs/Tabs.js");const a=require("./SignInForm.js");function c(u){const n=l.useGlobalStore(s.useShallow(i=>i.signIn));return e.jsxs(r.Root,{open:n.open,onOpenChange:i=>{n.setOpen(i.open)},lazyMount:!0,unmountOnExit:!0,closeOnEscape:!1,closeOnInteractOutside:!1,children:[e.jsx(r.Trigger,{asChild:!0,children:u.children??e.jsx("button",{type:"button",className:"px-3.5 font-semibold",children:"Login"})}),e.jsxs(t.Portal,{children:[e.jsx(r.Backdrop,{}),e.jsx(r.Positioner,{children:e.jsxs(r.Content,{className:"bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl",children:[e.jsx(r.CloseTrigger,{children:e.jsx(q.XIcon,{})}),e.jsx(o,{src:u.logo,alt:"",width:200,height:100,className:"mx-auto h-auto w-[120px]",draggable:!1}),e.jsx(a.SignInForm,{})]})})]})]})}exports.SignIn=c;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Portal as
|
|
4
|
-
import
|
|
5
|
-
import { useShallow as
|
|
2
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { Portal as p } from "@ark-ui/react";
|
|
4
|
+
import e from "next/image";
|
|
5
|
+
import { useShallow as n } from "zustand/shallow";
|
|
6
6
|
import "@opexa/portal-sdk-core";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "tiny-invariant";
|
|
@@ -15,73 +15,64 @@ import "../../utils/isMobile.mjs";
|
|
|
15
15
|
import "react";
|
|
16
16
|
import "lodash-es";
|
|
17
17
|
import "@opexa/portal-sdk-core/object-id";
|
|
18
|
-
import { useGlobalStore as
|
|
18
|
+
import { useGlobalStore as l } from "../../client/hooks/useGlobalStore.mjs";
|
|
19
19
|
import "../../client/hooks/useInfiniteQueryHelper.mjs";
|
|
20
20
|
import "usehooks-ts";
|
|
21
|
-
import { XIcon as
|
|
21
|
+
import { XIcon as a } from "../../icons/XIcon.mjs";
|
|
22
22
|
import "../../ui/AlertDialog/AlertDialog.mjs";
|
|
23
23
|
import "../../ui/Avatar/Avatar.mjs";
|
|
24
24
|
import "../../ui/Badge/Badge.mjs";
|
|
25
25
|
import "../../ui/Button/button.recipe.mjs";
|
|
26
26
|
import "../../ui/Checkbox/Checkbox.mjs";
|
|
27
27
|
import "../../ui/Clipboard/Clipboard.mjs";
|
|
28
|
+
import "../../ui/Collapsible/Collapsible.mjs";
|
|
28
29
|
import "../../ui/DatePicker/DatePicker.mjs";
|
|
29
|
-
import { Root as
|
|
30
|
+
import { Root as s, Trigger as c, Backdrop as u, Positioner as g, Content as h, CloseTrigger as d } from "../../ui/Dialog/Dialog.mjs";
|
|
30
31
|
import "../../ui/Drawer/Drawer.mjs";
|
|
31
32
|
import "../../ui/Field/Field.mjs";
|
|
32
33
|
import "../../ui/IconButton/iconButton.recipe.mjs";
|
|
33
34
|
import "../../ui/NumberInput/NumberInput.mjs";
|
|
35
|
+
import "../../ui/PasswordInput/PasswordInput.mjs";
|
|
34
36
|
import "../../ui/PinInput/PinInput.mjs";
|
|
35
37
|
import "../../ui/Popover/Popover.mjs";
|
|
36
38
|
import "tailwind-merge";
|
|
39
|
+
import "../../ui/Progress/Progress.mjs";
|
|
37
40
|
import "../../ui/SegmentGroup/SegmentGroup.mjs";
|
|
38
41
|
import "../../ui/Select/Select.mjs";
|
|
39
42
|
import "../../ui/Table/Table.mjs";
|
|
40
43
|
import "../../ui/Tabs/Tabs.mjs";
|
|
41
44
|
import { SignInForm as f } from "./SignInForm.mjs";
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
45
|
+
function eo(i) {
|
|
46
|
+
const m = l(n((t) => t.signIn));
|
|
47
|
+
return /* @__PURE__ */ r(
|
|
48
|
+
s,
|
|
46
49
|
{
|
|
47
|
-
open:
|
|
48
|
-
onOpenChange: (
|
|
49
|
-
|
|
50
|
+
open: m.open,
|
|
51
|
+
onOpenChange: (t) => {
|
|
52
|
+
m.setOpen(t.open);
|
|
50
53
|
},
|
|
51
54
|
lazyMount: !0,
|
|
52
55
|
unmountOnExit: !0,
|
|
53
56
|
closeOnEscape: !1,
|
|
54
57
|
closeOnInteractOutside: !1,
|
|
55
58
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
59
|
+
/* @__PURE__ */ o(c, { asChild: !0, children: i.children ?? /* @__PURE__ */ o("button", { type: "button", className: "px-3.5 font-semibold", children: "Login" }) }),
|
|
60
|
+
/* @__PURE__ */ r(p, { children: [
|
|
61
|
+
/* @__PURE__ */ o(u, {}),
|
|
62
|
+
/* @__PURE__ */ o(g, { children: /* @__PURE__ */ r(h, { className: "bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl", children: [
|
|
63
|
+
/* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(a, {}) }),
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
e,
|
|
62
66
|
{
|
|
63
|
-
src:
|
|
64
|
-
alt: "
|
|
65
|
-
width:
|
|
66
|
-
height:
|
|
67
|
-
className: "
|
|
67
|
+
src: i.logo,
|
|
68
|
+
alt: "",
|
|
69
|
+
width: 200,
|
|
70
|
+
height: 100,
|
|
71
|
+
className: "mx-auto h-auto w-[120px]",
|
|
72
|
+
draggable: !1
|
|
68
73
|
}
|
|
69
74
|
),
|
|
70
|
-
/* @__PURE__ */ o(
|
|
71
|
-
/* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(s, {}) }),
|
|
72
|
-
/* @__PURE__ */ t(
|
|
73
|
-
m,
|
|
74
|
-
{
|
|
75
|
-
src: r.logo,
|
|
76
|
-
alt: "",
|
|
77
|
-
width: 200,
|
|
78
|
-
height: 100,
|
|
79
|
-
className: "mx-auto h-auto w-[120px]",
|
|
80
|
-
draggable: !1
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ t(f, {})
|
|
84
|
-
] })
|
|
75
|
+
/* @__PURE__ */ o(f, {})
|
|
85
76
|
] }) })
|
|
86
77
|
] })
|
|
87
78
|
]
|
|
@@ -89,5 +80,5 @@ function it(r) {
|
|
|
89
80
|
);
|
|
90
81
|
}
|
|
91
82
|
export {
|
|
92
|
-
|
|
83
|
+
eo as SignIn
|
|
93
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@ark-ui/react"),j=require("@hookform/resolvers/zod"),S=require("react"),m=require("react-hook-form"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@ark-ui/react"),j=require("@hookform/resolvers/zod"),S=require("react"),m=require("react-hook-form"),i=require("zod"),w=require("zustand/shallow");require("@opexa/portal-sdk-core");require("@tanstack/react-query");require("tiny-invariant");require("../../constants/index.js");require("../../utils/capitalize.js");require("../../utils/parseDecimal.js");require("../../utils/getLocaleInfo.js");require("../../utils/getQueryClient.js");require("../../utils/isMobile.js");const k=require("../../client/hooks/useCooldown.js");require("@opexa/portal-sdk-core/object-id");const z=require("../../client/hooks/useGlobalStore.js");require("../../client/hooks/useInfiniteQueryHelper.js");const F=require("../../client/hooks/useLocaleInfo.js"),M=require("../../client/hooks/useMobileNumberParser.js");require("usehooks-ts");const R=require("../../client/hooks/useSendVerificationCodeMutation.js"),V=require("../../client/hooks/useSignInMutation.js"),q=require("../../client/utils/toaster.js"),L=require("../../icons/ArrowLeftIcon.js"),A=require("../../icons/CheckIcon.js"),B=require("../../icons/FacebookIcon.js"),O=require("../../icons/GoogleIcon.js");require("../../ui/AlertDialog/AlertDialog.js");require("../../ui/Avatar/Avatar.js");require("../../ui/Badge/Badge.js");const d=require("../../ui/Button/Button.js"),c=require("../../ui/Checkbox/Checkbox.js");require("../../ui/Clipboard/Clipboard.js");require("../../ui/Collapsible/Collapsible.js");require("../../ui/DatePicker/DatePicker.js");require("../../ui/Dialog/Dialog.js");require("../../ui/Drawer/Drawer.js");const x=require("../../ui/Field/Field.js");require("../../ui/IconButton/iconButton.recipe.js");require("../../ui/NumberInput/NumberInput.js");require("../../ui/PasswordInput/PasswordInput.js");const n=require("../../ui/PinInput/PinInput.js");require("../../ui/Popover/Popover.js");require("tailwind-merge");require("../../ui/Progress/Progress.js");require("../../ui/SegmentGroup/SegmentGroup.js");require("../../ui/Select/Select.js");require("../../ui/Table/Table.js");require("../../ui/Tabs/Tabs.js");function P(){var g;const[h,b]=S.useState(1),u=C.useDialogContext(),N=z.useGlobalStore(w.useShallow(t=>t.signUp)),y=V.useSignInMutation(),p=R.useSendVerificationCodeMutation(),f=F.useLocaleInfo(),a=M.useMobileNumberParser(),v=i.z.object({mobileNumber:i.z.string().superRefine((t,r)=>{a.validate(t)||r.addIssue({code:i.z.ZodIssueCode.custom,message:"Invalid mobile number"})}),termsAccepted:i.z.boolean().superRefine((t,r)=>{t||r.addIssue({code:i.z.ZodIssueCode.custom,message:"You must accept the terms and conditions"})})}),I=i.z.object({verificationCode:i.z.array(i.z.string().min(1).max(1).trim()).min(6).max(6)}),s=m.useForm({resolver:j.zodResolver(v),defaultValues:{mobileNumber:"",termsAccepted:!1}}),l=m.useForm({resolver:j.zodResolver(I),defaultValues:{verificationCode:Array.from({length:6}).fill("")}}),o=k.useCooldown({max:60,duration:1e3*60});return e.jsxs(e.Fragment,{children:[h===1&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"mt-xl text-center text-lg font-semibold",children:"Log in to your account"}),e.jsx("p",{className:"text-text-secondary-700 mt-xs text-center text-sm",children:"Welcome back! Please enter your details."}),e.jsxs("form",{className:"mt-3xl",onSubmit:s.handleSubmit(async t=>{try{await p.mutateAsync({channel:"SMS",recipient:a.format(t.mobileNumber),strict:!0}),b(2),o.start()}catch(r){q.toaster.error({description:r instanceof Error?r.message:"Failed to send verification code"})}}),children:[e.jsxs(x.Root,{invalid:!!s.formState.errors.mobileNumber,children:[e.jsx(x.Label,{children:"Mobile Number"}),e.jsxs("div",{className:"relative",children:[e.jsx(f.country.flag,{className:"absolute left-3.5 top-1/2 size-5 shrink-0 -translate-y-1/2"}),e.jsx(x.Input,{className:"pl-11",placeholder:`${f.mobileNumber.areaCode}${f.mobileNumber.example}`,...s.register("mobileNumber")})]}),e.jsx(x.ErrorText,{children:(g=s.formState.errors.mobileNumber)==null?void 0:g.message})]}),e.jsx(d.Button,{type:"submit",className:"mt-3xl",disabled:s.formState.isSubmitting,children:"Log In"}),e.jsx(m.Controller,{control:s.control,name:"termsAccepted",render:t=>e.jsxs(c.Root,{className:"mt-xl",invalid:t.fieldState.invalid,checked:t.field.value,onCheckedChange:r=>{t.field.onChange(r.checked)},children:[e.jsx(c.Control,{children:e.jsx(c.Indicator,{asChild:!0,children:e.jsx(A.CheckIcon,{})})}),e.jsxs(c.Label,{children:["I am at least 21 years of age and I accept the"," ",e.jsx("span",{className:"text-brand-400 whitespace-nowrap underline underline-offset-2",children:"Terms and Conditions."})]}),e.jsx(c.HiddenInput,{})]})})]}),e.jsxs("div",{className:"relative mt-6 text-center",children:[e.jsx("hr",{className:"-translte-y-1/2 text-text-tertiary-600/50 absolute top-1/2 w-full"}),e.jsx("span",{className:"text-text-tertiary-600 bg-bg-primary-alt relative px-md text-center text-sm font-semibold",children:"Log in directly with"})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs(d.Button,{variant:"outline",colorScheme:"gray",onClick:()=>{u.setOpen(!1)},className:"border-border-primary bg-bg-primary text-text-secondary-700",children:[e.jsx(O.GoogleIcon,{className:"size-6"}),"Continue with Google"]}),e.jsxs(d.Button,{variant:"outline",colorScheme:"gray",onClick:()=>{u.setOpen(!1)},className:"border-border-primary bg-bg-primary text-text-secondary-700 mt-lg",children:[e.jsx(B.FacebookIcon,{className:"size-6"}),"Continue with Facebook"]})]}),e.jsxs("div",{className:"mt-6 flex w-full items-center justify-center gap-xs text-sm",children:[e.jsx("span",{className:"text-text-tertiary-600",children:"Don't have an account?"}),e.jsx("button",{type:"submit",className:"text-button-tertiary-fg font-semibold",onClick:()=>{u.setOpen(!1),N.setOpen(!0)},children:"Sign up"})]})]}),h===2&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"mt-xl text-center text-lg font-semibold",children:"Check your Phone"}),e.jsxs("p",{className:"text-text-secondary-700 mt-xs text-center text-sm",children:["We’ve sent a verification code to your mobile number"," ",e.jsx("span",{className:"font-semibold",children:a.format(s.getValues("mobileNumber"))})," ","via text"]}),e.jsxs("form",{className:"mt-5",onSubmit:l.handleSubmit(async({verificationCode:t})=>{const{mobileNumber:r}=s.getValues();try{await y.mutateAsync({type:"MOBILE_NUMBER",mobileNumber:a.format(r),verificationCode:t.join("")}),u.setOpen(!1),s.reset(),l.reset(),b(1)}catch{q.toaster.error({description:"Invalid Verification Code"})}}),children:[e.jsx(m.Controller,{name:"verificationCode",control:l.control,render:t=>e.jsxs(n.Root,{placeholder:"0",invalid:t.fieldState.invalid,value:t.field.value,onValueChange:r=>{t.field.onChange(r.value)},children:[e.jsxs(n.Control,{className:"grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md",children:[e.jsx(n.Input,{index:0}),e.jsx(n.Input,{index:1}),e.jsx(n.Input,{index:2}),e.jsx("span",{className:"text-text-placeholder-subtle text-2xl font-medium",children:"–"}),e.jsx(n.Input,{index:3}),e.jsx(n.Input,{index:4}),e.jsx(n.Input,{index:5})]}),e.jsx(n.HiddenInput,{})]})}),e.jsx(d.Button,{type:"submit",className:"mt-4xl",disabled:l.formState.isSubmitting,children:"Verify"}),e.jsxs("div",{className:"mt-3 flex w-full items-center justify-center gap-xs text-sm",children:[e.jsx("span",{className:"text-text-secondary-700",children:"Didn't recieve the code?"}),e.jsx("button",{type:"button",className:"text-button-secondary-fg font-semibold",disabled:o.cooling,onClick:async()=>{await p.mutateAsync({channel:"SMS",recipient:a.format(s.getValues("mobileNumber"))}),o.start()},children:o.cooling?`Resend in ${o.countdown}s`:"Resend"})]}),e.jsxs("button",{type:"button",className:"text-text-tertiary-600 mx-auto mt-3xl flex w-fit items-center gap-1 text-sm font-semibold",onClick:()=>{b(1),l.reset(),o.stop()},children:[e.jsx(L.ArrowLeftIcon,{className:"size-5"}),"Back"]})]})]})]})}exports.SignInForm=P;
|