@opexa/portal-components 0.0.534 → 0.0.536
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/components/AccountInfo/AccountInfo.d.ts +1 -0
- package/dist/components/AccountInfo/AccountInfo.js +3 -3
- package/dist/components/SignIn/SignInMethod.d.ts +1 -1
- package/dist/components/SignIn/SignInMethod.js +2 -0
- package/dist/components/SignIn/useSignIn.d.ts +2 -0
- package/dist/components/SignIn/useSignIn.js +5 -1
- package/dist/components/SignUp/SignUpNameAndPassword/SignUpNameAndPasswordForm.js +8 -4
- package/dist/services/queries.d.ts +1 -1
- package/dist/services/queries.js +1 -0
- package/dist/types/index.d.ts +1 -0
- 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.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.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/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.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ const accountSchema = z.object({
|
|
|
41
41
|
.regex(/^[a-zA-Z0-9]+$/, 'Username can only contain letters and numbers'),
|
|
42
42
|
});
|
|
43
43
|
export function AccountInfo(props) {
|
|
44
|
-
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, {}), _jsx(SSO, { google: props.googleSso, facebook: props.facebookSso })] }));
|
|
44
|
+
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, { shouldShowBranchCode: props.shouldShowBranchCode }), _jsx(SSO, { google: props.googleSso, facebook: props.facebookSso })] }));
|
|
45
45
|
}
|
|
46
46
|
function ProfileInfo() {
|
|
47
47
|
const [edit, setEdit] = useState(false);
|
|
@@ -84,7 +84,7 @@ function ProfileInfo() {
|
|
|
84
84
|
form.reset();
|
|
85
85
|
}, children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || isPending, children: "Save Changes" })] })] })) : (_jsxs("div", { className: "mt-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h3", { className: "font-semibold text-lg text-text-secondary-700 leading-tight", children: account?.name }), _jsx("button", { type: "button", onClick: () => setEdit(true), children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none", viewBox: "0 0 24 24", stroke: "#cecfd2", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963z" }) }) })] }), _jsx("p", { className: "text-text-tertiary-600 leading-tight", children: account?.id })] }))] }) }) })] }));
|
|
86
86
|
}
|
|
87
|
-
function PersonalInfo() {
|
|
87
|
+
function PersonalInfo({ shouldShowBranchCode, }) {
|
|
88
88
|
const accountQuery = useAccountQuery();
|
|
89
89
|
const account = accountQuery.data;
|
|
90
90
|
const updateAccountMutation = useUpdateAccountMutation({
|
|
@@ -145,7 +145,7 @@ function PersonalInfo() {
|
|
|
145
145
|
? data.birthDay
|
|
146
146
|
: undefined,
|
|
147
147
|
});
|
|
148
|
-
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
148
|
+
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), shouldShowBranchCode && (_jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Branch Code" }), _jsx(Field.Input, { type: "text", disabled: true, value: account?.branchCode ?? '' })] }))] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
149
149
|
}
|
|
150
150
|
function ContactInfo() {
|
|
151
151
|
const localeInfo = useLocaleInfo();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function SignInMethod(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function SignInMethod(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -12,6 +12,8 @@ const METHOD_LABEL_MAP = {
|
|
|
12
12
|
};
|
|
13
13
|
export function SignInMethod() {
|
|
14
14
|
const context = useSignInContext();
|
|
15
|
+
if (context.types.length <= 1)
|
|
16
|
+
return null;
|
|
15
17
|
return (_jsxs(SegmentGroup.Root, { value: context.type, onValueChange: (details) => {
|
|
16
18
|
context.setStep(1);
|
|
17
19
|
context.setType(z.enum(METHODS).parse(details.value));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type SignInStep = 1 | 2 | (number & {});
|
|
2
2
|
export type SignInType = 'NAME_AND_PASSWORD' | 'MOBILE_NUMBER';
|
|
3
3
|
export interface UseSignInProps {
|
|
4
|
+
types?: SignInType[];
|
|
4
5
|
defaultType?: SignInType;
|
|
5
6
|
}
|
|
6
7
|
export interface UseSignInReturn {
|
|
@@ -8,5 +9,6 @@ export interface UseSignInReturn {
|
|
|
8
9
|
setStep: (step: SignInStep) => void;
|
|
9
10
|
type: SignInType;
|
|
10
11
|
setType: (type: SignInType) => void;
|
|
12
|
+
types: SignInType[];
|
|
11
13
|
}
|
|
12
14
|
export declare function useSignIn(props?: UseSignInProps): UseSignInReturn;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
export function useSignIn(props) {
|
|
3
|
+
const types = !props?.types?.length
|
|
4
|
+
? ['MOBILE_NUMBER', 'NAME_AND_PASSWORD']
|
|
5
|
+
: props.types;
|
|
3
6
|
const [step, setStep] = useState(1);
|
|
4
|
-
const [type, setType] = useState(props?.defaultType ??
|
|
7
|
+
const [type, setType] = useState(props?.defaultType ?? types[0]);
|
|
5
8
|
return {
|
|
6
9
|
step,
|
|
7
10
|
setStep,
|
|
8
11
|
type,
|
|
9
12
|
setType,
|
|
13
|
+
types,
|
|
10
14
|
};
|
|
11
15
|
}
|
|
@@ -20,6 +20,8 @@ import { CheckIcon } from '../../../icons/CheckIcon.js';
|
|
|
20
20
|
import { ChevronDownIcon } from '../../../icons/ChevronDownIcon.js';
|
|
21
21
|
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
22
22
|
import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
|
|
23
|
+
import { EyeIcon } from '../../../icons/EyeIcon.js';
|
|
24
|
+
import { EyeOffIcon } from '../../../icons/EyeOffIcon.js';
|
|
23
25
|
import { HelpCircleIcon } from '../../../icons/HelpCircleIcon.js';
|
|
24
26
|
import pagcorLogo from '../../../images/pagcor-round-icon.png';
|
|
25
27
|
import responsibleGamingLogo from '../../../images/responsible-gaming-gold.png';
|
|
@@ -28,6 +30,7 @@ import { Button } from '../../../ui/Button/index.js';
|
|
|
28
30
|
import { Checkbox } from '../../../ui/Checkbox/index.js';
|
|
29
31
|
import { DatePicker } from '../../../ui/DatePicker/index.js';
|
|
30
32
|
import { Field } from '../../../ui/Field/index.js';
|
|
33
|
+
import { PasswordInput } from '../../../ui/PasswordInput/index.js';
|
|
31
34
|
import { Select } from '../../../ui/Select/index.js';
|
|
32
35
|
import { Tooltip } from '../../../ui/Tooltip/index.js';
|
|
33
36
|
import { createPoll } from '../../../utils/createPoll.js';
|
|
@@ -54,13 +57,14 @@ export function SignUpNameAndPasswordForm() {
|
|
|
54
57
|
name: z
|
|
55
58
|
.string()
|
|
56
59
|
.trim()
|
|
57
|
-
.
|
|
58
|
-
.
|
|
60
|
+
.regex(/^[0-9a-z]*$/, 'Name must be alphanumeric')
|
|
61
|
+
.min(6, 'Name must be 6 or more characters')
|
|
62
|
+
.max(20, 'Name must not be more that 20 characters'),
|
|
59
63
|
password: z
|
|
60
64
|
.string()
|
|
61
65
|
.trim()
|
|
62
66
|
.min(8, 'Password must be 8 or more characters')
|
|
63
|
-
.max(
|
|
67
|
+
.max(32, 'Password must not be more that 32 characters'),
|
|
64
68
|
termsAccepted: z.boolean().superRefine((v, ctx) => {
|
|
65
69
|
if (!v) {
|
|
66
70
|
ctx.addIssue({
|
|
@@ -168,7 +172,7 @@ export function SignUpNameAndPasswordForm() {
|
|
|
168
172
|
description: error instanceof Error ? error.message : 'Something went wrong',
|
|
169
173
|
});
|
|
170
174
|
}
|
|
171
|
-
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your name", ...form.register('name') }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.password, className: "mt-xl", children: [_jsx(
|
|
175
|
+
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Name" }), _jsx(Field.Input, { placeholder: "Enter your name", ...form.register('name') }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.password, className: "mt-xl", children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.firstName, className: "mt-xl", children: [_jsx(Field.Label, { children: "First Name" }), _jsx(Field.Input, { placeholder: "Enter your first name", ...form.register('firstName') }), _jsx(Field.ErrorText, { children: form.formState.errors.firstName?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.lastName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Last Name" }), _jsx(Field.Input, { placeholder: "Enter your last name", ...form.register('lastName') }), _jsx(Field.ErrorText, { children: form.formState.errors.lastName?.message })] }), _jsxs(Field.Root, { invalid: !!form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: form.watch('birthDay'), onChange: (value) => {
|
|
172
176
|
if (!value)
|
|
173
177
|
return;
|
|
174
178
|
form.setValue('birthDay', value, {
|
|
@@ -68,7 +68,7 @@ export declare const MEMBER = "\n query Member {\n member {\n dateTimeL
|
|
|
68
68
|
/**
|
|
69
69
|
* _aka_ `Query.self`
|
|
70
70
|
*/
|
|
71
|
-
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n cellxpertDetails {\n cxd\n dateTimeLastUpdated\n }\n }\n }\n }\n";
|
|
71
|
+
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n branchCode\n cellxpertDetails {\n cxd\n dateTimeLastUpdated\n }\n }\n }\n }\n";
|
|
72
72
|
export declare const MEMBER_VERIFICATION = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query MemberVerification {\n memberAccount: self {\n ... on MemberAccount {\n verification {\n id\n status\n address\n permanentAddress\n sourceOfIncome\n natureOfWork\n nationality\n placeOfBirth\n idFrontImage {\n ...FileFragment\n }\n selfieImage {\n ...FileFragment\n }\n sumsubVerified\n }\n }\n }\n }\n";
|
|
73
73
|
export declare const REGISTER_MEMBER_ACCOUNT = "\n mutation RegisterMemberAccount(\n $input: RegisterMemberAccountInput!\n $referralCode: String\n $verificationCode: String\n $reCAPTCHAResponse: String\n ) {\n registerMemberAccount(\n input: $input\n referralCode: $referralCode\n verificationCode: $verificationCode\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n ... on InvalidSMSVerificationCodeError {\n name: __typename\n message\n }\n ... on MinimumAgeRequirementError {\n name: __typename\n message\n }\n ... on MobileNumberNotAvailableError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
74
74
|
export declare const REGISTER_MEMBER_ACCOUNT_BY_NAME = "\n mutation RegisterMemberAccountByName(\n $input: RegisterMemberAccountByNameInput!\n $reCAPTCHAResponse: String!\n ) {\n registerMemberAccountByName(\n input: $input\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n }\n }\n";
|
package/dist/services/queries.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -457,6 +457,7 @@ export interface MemberAccount {
|
|
|
457
457
|
secretAnswerSubmitted?: boolean | null;
|
|
458
458
|
dateTimeCreated: string;
|
|
459
459
|
dateTimeLastUpdated: string;
|
|
460
|
+
branchCode?: string | null;
|
|
460
461
|
googleId?: string | null;
|
|
461
462
|
facebookId?: string | null;
|
|
462
463
|
cellxpertDetails?: {
|