@mbao01/common 0.4.3 → 0.4.4

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,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
- import { PhoneProps } from './types';
3
- declare const Phone: React.ForwardRefExoticComponent<PhoneProps & React.RefAttributes<HTMLInputElement>>;
2
+ declare const Phone: React.ForwardRefExoticComponent<Omit<import('../Input/types').InputProps, "type" | "inputMode" | "label"> & Pick<import('react-international-phone').UsePhoneInputConfig, "defaultCountry"> & React.RefAttributes<HTMLInputElement>>;
4
3
  export { Phone };
@@ -1,2 +1,3 @@
1
+ import { UsePhoneInputConfig } from 'react-international-phone';
1
2
  import { InputProps } from '../Input/types';
2
- export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode">;
3
+ export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode"> & Pick<UsePhoneInputConfig, "defaultCountry">;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mbao01/common",
3
3
  "private": false,
4
- "version": "0.4.3",
4
+ "version": "0.4.4",
5
5
  "type": "module",
6
6
  "author": "Ayomide Bakare",
7
7
  "license": "MIT",
@@ -168,5 +168,5 @@
168
168
  "recharts": "2",
169
169
  "typescript": "5"
170
170
  },
171
- "gitHead": "f1e87f8fc6fc61de80777905e5d8e3bb214fab28"
171
+ "gitHead": "e3e23ca85c4e11eb4e1ce1c07bc110f9d639b818"
172
172
  }
@@ -22,14 +22,15 @@ const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
22
22
  outline,
23
23
  wide,
24
24
  size,
25
+ defaultCountry = "us",
25
26
  ...props
26
27
  },
27
28
  ref
28
29
  ) => {
29
30
  const [open, setOpen] = React.useState(false);
30
31
  const { inputValue, handlePhoneValueChange, inputRef, country, setCountry } = usePhoneInput({
31
- value: defaultValue ? String(defaultValue) : "+231",
32
- defaultCountry: "lr",
32
+ value: defaultValue ? String(defaultValue) : "",
33
+ defaultCountry,
33
34
  forceDialCode: true,
34
35
  inputRef: ref as MutableRefObject<HTMLInputElement | null>,
35
36
  });
@@ -1,3 +1,5 @@
1
+ import { UsePhoneInputConfig } from "react-international-phone";
1
2
  import { type InputProps } from "../Input/types";
2
3
 
3
- export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode">;
4
+ export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode"> &
5
+ Pick<UsePhoneInputConfig, "defaultCountry">;