@opexa/portal-components 0.0.45 → 0.0.47
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 +1 -0
- package/dist/client/hooks/index.js +1 -0
- package/dist/client/hooks/useCreateGCashDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -1
- package/dist/client/hooks/useMobileNumberParser.d.ts +1 -0
- package/dist/client/hooks/useMobileNumberParser.js +17 -6
- package/dist/client/hooks/useUpdateAccountMutation.d.ts +3 -0
- package/dist/client/hooks/useUpdateAccountMutation.js +61 -0
- package/dist/components/Account/Account.js +7 -2
- package/dist/components/AccountInfo/AccountInfo.js +116 -8
- package/dist/components/AccountSecurity/AccountSecurity.js +121 -5
- package/dist/components/AccountVerification/AccountVerification.js +33 -6
- package/dist/components/BetRecords/BetRecords.js +5 -16
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/KYC/AccountVerificationContext.d.ts +14 -0
- package/dist/components/KYC/AccountVerificationContext.js +27 -0
- package/dist/components/KYC/KYC.d.ts +1 -1
- package/dist/components/KYC/KYC.js +12 -1
- package/dist/components/KYC/KYCContext.d.ts +1 -0
- package/dist/components/KYC/KYCContext.js +3 -0
- package/dist/components/KYC/KYCTrigger.d.ts +5 -0
- package/dist/components/KYC/KYCTrigger.js +14 -0
- package/dist/components/KYC/VerificationCapture.d.ts +1 -0
- package/dist/components/KYC/VerificationCapture.js +28 -0
- package/dist/components/KYC/VerificationComplete.d.ts +1 -0
- package/dist/components/KYC/VerificationComplete.js +9 -0
- package/dist/components/KYC/VerificationDetails.d.ts +1 -0
- package/dist/components/KYC/VerificationDetails.js +38 -0
- package/dist/components/KYC/index.d.ts +1 -0
- package/dist/components/KYC/index.js +1 -0
- package/dist/components/KYC/useKYC.d.ts +6 -0
- package/dist/components/KYC/useKYC.js +8 -0
- package/dist/components/Messages/Messages.d.ts +14 -1
- package/dist/components/Messages/Messages.js +11 -4
- package/dist/components/TransactionRecords/DepositRecordsTable.js +5 -17
- package/dist/components/TransactionRecords/TransactionRecords.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +5 -17
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +5 -17
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/styles/theme.css +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +238 -238
- package/dist/ui/Combobox/combobox.recipe.d.ts +17 -17
- package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
- package/dist/ui/Dialog/Dialog.d.ts +55 -55
- package/dist/ui/Dialog/dialog.recipe.d.ts +5 -5
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- 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.recipe.d.ts +3 -3
- package/dist/ui/Table/table.recipe.js +1 -1
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/utils/queryKeys.d.ts +1 -0
- package/dist/utils/queryKeys.js +3 -0
- package/package.json +3 -3
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createListCollection, Portal } from '@ark-ui/react';
|
|
3
2
|
import { tz, TZDateMini } from '@date-fns/tz';
|
|
4
3
|
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
5
4
|
import { useState } from 'react';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { useInfiniteQueryHelper, useLocaleInfo, useTransactionRecordsQuery, } from '../../client/hooks/index.js';
|
|
8
|
-
import {
|
|
9
|
-
import { IconButton,
|
|
7
|
+
import { ChevronLeftIcon, ChevronRightIcon, File02Icon, SpinnerIcon, } from '../../icons/index.js';
|
|
8
|
+
import { IconButton, Table } from '../../ui/index.js';
|
|
10
9
|
import { capitalize, formatNumber } from '../../utils/index.js';
|
|
11
10
|
import { Empty } from '../Empty.js';
|
|
12
11
|
import { TableFilters } from './TableFilters.js';
|
|
13
12
|
export function TransactionRecordsTable() {
|
|
14
13
|
const [timestamp, setTimestamp] = useState();
|
|
15
14
|
const localeInfo = useLocaleInfo();
|
|
16
|
-
const { page,
|
|
15
|
+
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useTransactionRecordsQuery, {
|
|
17
16
|
filter: {
|
|
18
17
|
...(timestamp && {
|
|
19
18
|
dateTimeCreated: {
|
|
@@ -36,7 +35,7 @@ export function TransactionRecordsTable() {
|
|
|
36
35
|
transactionType: true,
|
|
37
36
|
} }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
38
37
|
? 'Fetching latest transaction records...'
|
|
39
|
-
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-
|
|
38
|
+
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'relative', 'left-1/2', 'right-1/2', '-mx-[50dvw]', 'w-dvw', 'lg:mt-3xl', 'lg:-mx-0', 'lg:-ml-0', 'lg:left-0', 'lg:right-0', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Transaction Type" }), _jsx(Table.Heading, { children: "Transaction Time" }), _jsx(Table.Heading, { children: "Amount" }), _jsx(Table.Heading, { children: "Current Balance" }), _jsx(Table.Heading, { children: "Reference Number" }), _jsx(Table.Heading, { children: "Content" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
|
|
40
39
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
41
40
|
}) }), _jsxs(Table.Cell, { className: "!py-1", children: [_jsx("div", { className: "leading-tight", children: format(data.dateTimeCreated, 'MM/dd/yyyy', {
|
|
42
41
|
in: tz(localeInfo.timezone),
|
|
@@ -48,16 +47,5 @@ export function TransactionRecordsTable() {
|
|
|
48
47
|
}) }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.currentBalance, {
|
|
49
48
|
currency: localeInfo.currency.code,
|
|
50
49
|
minDecimalPlaces: 2,
|
|
51
|
-
}) }), _jsx(Table.Cell, { className: "!py-1", children: data.referenceNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.content || '/' })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center gap-lg px-4 py-3", children: [_jsxs("p", { className: "text-text-secondary-700
|
|
52
|
-
const n = parseInt(details.value[0]);
|
|
53
|
-
const v = isNaN(n) ? 10 : n;
|
|
54
|
-
setPageSize(v);
|
|
55
|
-
}, collection: pageSizeCollection, lazyMount: true, className: "hidden lg:block", positioning: {
|
|
56
|
-
sameWidth: true,
|
|
57
|
-
}, children: _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: pageSizeCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: pageSizeCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) })] }) }), _jsxs("div", { className: "contents lg:flex", children: [_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", className: "order-1 lg:order-none lg:rounded-r-none lg:border-r-0", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", className: "order-3 lg:order-none lg:rounded-l-none", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] })] }))] }));
|
|
50
|
+
}) }), _jsx(Table.Cell, { className: "!py-1", children: data.referenceNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.content || '/' })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
|
|
58
51
|
}
|
|
59
|
-
const pageSizeCollection = createListCollection({
|
|
60
|
-
items: useInfiniteQueryHelper.config.pageSizes,
|
|
61
|
-
itemToValue: (item) => item.toString(),
|
|
62
|
-
itemToString: (item) => `${item} items per page`,
|
|
63
|
-
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createListCollection, Portal } from '@ark-ui/react';
|
|
3
2
|
import { tz, TZDateMini } from '@date-fns/tz';
|
|
4
3
|
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
5
4
|
import { useState } from 'react';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { useInfiniteQueryHelper, useLocaleInfo, useWithdrawalRecordsQuery, } from '../../client/hooks/index.js';
|
|
8
|
-
import {
|
|
9
|
-
import { Badge, IconButton,
|
|
7
|
+
import { ChevronLeftIcon, ChevronRightIcon, File02Icon, SpinnerIcon, } from '../../icons/index.js';
|
|
8
|
+
import { Badge, IconButton, Table } from '../../ui/index.js';
|
|
10
9
|
import { capitalize, formatNumber } from '../../utils/index.js';
|
|
11
10
|
import { Empty } from '../Empty.js';
|
|
12
11
|
import { TableFilters } from './TableFilters.js';
|
|
@@ -14,7 +13,7 @@ export function WithdrawalRecordsTable() {
|
|
|
14
13
|
const [timestamp, setTimestamp] = useState();
|
|
15
14
|
const [withdrawalStatus, setWithdrawalStatus] = useState();
|
|
16
15
|
const localeInfo = useLocaleInfo();
|
|
17
|
-
const { page,
|
|
16
|
+
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useWithdrawalRecordsQuery, {
|
|
18
17
|
filter: {
|
|
19
18
|
...(withdrawalStatus && {
|
|
20
19
|
status: {
|
|
@@ -44,7 +43,7 @@ export function WithdrawalRecordsTable() {
|
|
|
44
43
|
setWithdrawalStatus(value.withdrawalStatus);
|
|
45
44
|
} }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
46
45
|
? 'Fetching latest withdrawal records...'
|
|
47
|
-
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-
|
|
46
|
+
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'relative', 'left-1/2', 'right-1/2', '-mx-[50dvw]', 'w-dvw', 'lg:mt-3xl', 'lg:-mx-0', 'lg:-ml-0', 'lg:left-0', 'lg:right-0', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
|
|
48
47
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
49
48
|
}) }), _jsx(Table.Cell, { className: "!py-1", children: data.recipientMobileNumber }), _jsx(Table.Cell, { className: "!py-1", children: formatNumber(data.amount, {
|
|
50
49
|
currency: localeInfo.currency.code,
|
|
@@ -67,16 +66,5 @@ export function WithdrawalRecordsTable() {
|
|
|
67
66
|
? 'warning'
|
|
68
67
|
: 'success', children: _jsx(Badge.Label, { children: capitalize(data.status, {
|
|
69
68
|
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
70
|
-
}) }) }) })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center gap-lg px-4 py-3", children: [_jsxs("p", { className: "text-text-secondary-700
|
|
71
|
-
const n = parseInt(details.value[0]);
|
|
72
|
-
const v = isNaN(n) ? 10 : n;
|
|
73
|
-
setPageSize(v);
|
|
74
|
-
}, collection: pageSizeCollection, lazyMount: true, className: "hidden lg:block", positioning: {
|
|
75
|
-
sameWidth: true,
|
|
76
|
-
}, children: _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: pageSizeCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: pageSizeCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) })] }) }), _jsxs("div", { className: "contents lg:flex", children: [_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", className: "order-1 lg:order-none lg:rounded-r-none lg:border-r-0", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", className: "order-3 lg:order-none lg:rounded-l-none", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] })] }))] }));
|
|
69
|
+
}) }) }) })] }, data.id))) })] }) }), _jsxs("div", { className: "flex items-center justify-between gap-lg px-4 py-3", children: [_jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasPrevPage || loading, onClick: () => prev(), children: _jsx(ChevronLeftIcon, { className: "size-5" }) }), _jsxs("p", { className: "text-text-secondary-700 text-sm font-medium", children: ["Page ", page, " of ", totalPages] }), _jsx(IconButton, { size: "xs", variant: "outline", colorScheme: "gray", disabled: !hasNextPage || loading, onClick: () => next(), children: _jsx(ChevronRightIcon, { className: "size-5" }) })] })] }))] }));
|
|
77
70
|
}
|
|
78
|
-
const pageSizeCollection = createListCollection({
|
|
79
|
-
items: useInfiniteQueryHelper.config.pageSizes,
|
|
80
|
-
itemToValue: (item) => item.toString(),
|
|
81
|
-
itemToString: (item) => `${item} items per page`,
|
|
82
|
-
});
|
package/dist/components/index.js
CHANGED
package/dist/styles/theme.css
CHANGED
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
input::-webkit-search-cancel-button,
|
|
36
36
|
input::-webkit-search-decoration,
|
|
37
37
|
input::-webkit-search-results-button,
|
|
38
|
-
input::-webkit-search-results-decoration
|
|
39
|
-
input::-webkit-calendar-picker-indicator {
|
|
38
|
+
input::-webkit-search-results-decoration {
|
|
40
39
|
display: none;
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -212,6 +211,7 @@
|
|
|
212
211
|
--color-bg-brand-secondary: #ca8504;
|
|
213
212
|
--color-bg-brand-secondary-alt: #22262f;
|
|
214
213
|
--color-bg-secondary: #13161b;
|
|
214
|
+
--color-bg-secondary-alt: #0c0e12;
|
|
215
215
|
--color-bg-tertiary: #22262f;
|
|
216
216
|
--color-bg-quaternary: #373a41;
|
|
217
217
|
--color-bg-active: #22262f;
|