@opexa/portal-components 0.0.875 → 0.0.878

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.
@@ -1,7 +1,7 @@
1
1
  export declare const OnlineBankDepositContext: (props: {
2
2
  value: {
3
3
  view: "form" | "vca";
4
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
7
7
  deposit: import("../../../../types").Deposit | null;
@@ -14,7 +14,7 @@ export declare const OnlineBankDepositContext: (props: {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useOnlineBankDepositContext: () => {
16
16
  view: "form" | "vca";
17
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
17
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
20
20
  deposit: import("../../../../types").Deposit | null;
@@ -2,7 +2,7 @@ import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
4
  view: "form" | "vca";
5
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
8
8
  deposit: Deposit | null;
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
3
+ status: "idle" | "failed" | "confirmed" | "generating-qr-code" | "qr-code-generated";
4
4
  deposit: import("../../../../types").Deposit | null;
5
5
  errorMessage: {
6
6
  name: string;
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useQRPHDepositContext: () => {
16
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
16
+ status: "idle" | "failed" | "confirmed" | "generating-qr-code" | "qr-code-generated";
17
17
  deposit: import("../../../../types").Deposit | null;
18
18
  errorMessage: {
19
19
  name: string;
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
5
5
  promo?: string | null;
6
6
  }
7
7
  export declare function useQRPHDeposit(): {
8
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
8
+ status: "idle" | "failed" | "confirmed" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  errorMessage: {
11
11
  name: string;
@@ -26,7 +26,9 @@ export const MobileNumberField = ({ enabledCountries, mobileNumber, onMobileNumb
26
26
  // Avoid forcing controlled mode if RHF wants uncontrolled; still safe if value passed
27
27
  value: mobileNumber, onChange: handleMobileChange, placeholder: "Enter mobile number" })] }), _jsx(Field.ErrorText, { children: error })] }));
28
28
  }
29
- return (_jsxs(Field.Root, { invalid: !!error, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative flex gap-2", children: [_jsxs(Popover.Root, { open: isPopoverOpen, closeOnEscape: false, closeOnInteractOutside: false, onOpenChange: () => {
29
+ return (_jsxs(Field.Root, { invalid: !!error, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative flex gap-2", children: [_jsxs(Popover.Root, { open: isPopoverOpen, onInteractOutside: () => {
30
+ setIsPopoverOpen(false);
31
+ }, onOpenChange: () => {
30
32
  setSearch('');
31
33
  }, children: [_jsx(Popover.Trigger, { onClick: () => {
32
34
  setIsPopoverOpen(!isPopoverOpen);
@@ -29,6 +29,7 @@ import { Checkbox } from '../../ui/Checkbox/index.js';
29
29
  import { Field } from '../../ui/Field/index.js';
30
30
  import { PinInput } from '../../ui/PinInput/index.js';
31
31
  import { countryCodeParser } from '../../utils/countries/countryCodeParser.js';
32
+ import { getCountryDetails } from '../../utils/countries/getAllCountries.js';
32
33
  import { LOCALSTORAGE_PUSH_NOTIFICATION_TOKEN_KEY } from '../PortalProvider/PushNotifications.js';
33
34
  import { FacebookSignInTrigger } from './FacebookSignInTrigger.js';
34
35
  import { MobileNumberField } from './MobileNumberField.js';
@@ -61,7 +62,7 @@ const Step1Definition = (countryCode) => z.object({
61
62
  export function MobileNumberSignInInternational() {
62
63
  const signInProps = useSignInPropsContext();
63
64
  const localeInfo = useLocaleInfo();
64
- const [areaCode, setAreaCode] = useState(localeInfo.country.code);
65
+ const [areaCode, setAreaCode] = useState(getCountryDetails(localeInfo.country.code).areaCode);
65
66
  const router = useRouter();
66
67
  const context = useSignInContext();
67
68
  const globalStore = useGlobalStore(useShallow((ctx) => ({
@@ -13,6 +13,7 @@ import { z } from 'zod';
13
13
  import { useShallow } from 'zustand/shallow';
14
14
  import { useCooldown } from '../../../client/hooks/useCooldown.js';
15
15
  import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
16
+ import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
16
17
  import { useSendVerificationCodeMutation } from '../../../client/hooks/useSendVerificationCodeMutation.js';
17
18
  import { useSignInMutation } from '../../../client/hooks/useSignInMutation.js';
18
19
  import { useSignUpMutation } from '../../../client/hooks/useSignUpMutation.js';
@@ -31,13 +32,15 @@ import { PinInput } from '../../../ui/PinInput/index.js';
31
32
  import { Select } from '../../../ui/Select/index.js';
32
33
  import { Tooltip } from '../../../ui/Tooltip/index.js';
33
34
  import { countryCodeParser } from '../../../utils/countries/countryCodeParser.js';
35
+ import { getCountryDetails } from '../../../utils/countries/getAllCountries.js';
34
36
  import { createPoll } from '../../../utils/createPoll.js';
35
37
  import DateOfBirthField from '../../DateOfBirthField.js';
36
38
  import { MobileNumberField } from '../../SignIn/MobileNumberField.js';
37
39
  import { useSignUpDefaultPropsContext } from './SignUpDefaultContext.js';
38
40
  export function SignUpDefaultFormInternational() {
39
41
  const signUpProps = useSignUpDefaultPropsContext();
40
- const [areaCode, setAreaCode] = useState('');
42
+ const localeInfo = useLocaleInfo();
43
+ const [areaCode, setAreaCode] = useState(getCountryDetails(localeInfo.country.code).areaCode);
41
44
  const branchCollection = createListCollection({
42
45
  items: signUpProps.branches ?? [],
43
46
  itemToValue: (item) => item.code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.875",
3
+ "version": "0.0.878",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",