react-simple-phone-input 1.0.6-beta → 1.0.8-beta

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.
@@ -0,0 +1,5 @@
1
+ export declare const countryData: {
2
+ country: string;
3
+ countryCode: string;
4
+ callingCode: string;
5
+ }[];
@@ -0,0 +1,20 @@
1
+ export interface CountryDataTypes {
2
+ country: string;
3
+ countryCode: string;
4
+ callingCode: string;
5
+ }
6
+ export declare const getDefaultCountry: (code: string) => {
7
+ country: string;
8
+ countryCode: string;
9
+ callingCode: string;
10
+ } | undefined;
11
+ export declare const getBySearch: (search: string, onlyCountry?: string[], excludeCountry?: string[]) => {
12
+ country: string;
13
+ countryCode: string;
14
+ callingCode: string;
15
+ }[];
16
+ export declare const getCountryByFilter: (onlyCountry: string[], excludeCountry: string[], preferredCountry: string[]) => {
17
+ country: string;
18
+ countryCode: string;
19
+ callingCode: string;
20
+ }[];
@@ -0,0 +1 @@
1
+ export declare function useOnClickOutside(ref: any, handler: any): void;
@@ -1,3 +1,22 @@
1
- /// <reference types="react" />
2
- declare const PhoneInput: () => JSX.Element;
1
+ import React, { ReactNode } from "react";
2
+ interface Props {
3
+ placeholder: string;
4
+ country: string;
5
+ onChange: (e: string) => void;
6
+ value?: string;
7
+ iconComponent?: ReactNode;
8
+ inputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
9
+ onlyCountries?: string[];
10
+ excludeCountries?: string[];
11
+ preferredCountries?: string[];
12
+ showDropdownIcon?: boolean;
13
+ dialCodeInputField?: boolean;
14
+ search?: boolean;
15
+ searchPlaceholder?: string;
16
+ showSearchIcon?: boolean;
17
+ searchIconComponent?: ReactNode;
18
+ searchProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
19
+ searchNotFound?: string;
20
+ }
21
+ declare const PhoneInput: ({ placeholder, country, onChange, value, iconComponent, inputProps, onlyCountries, excludeCountries, preferredCountries, showDropdownIcon, dialCodeInputField, search, searchPlaceholder, showSearchIcon, searchIconComponent, searchProps, searchNotFound }: Props) => JSX.Element;
3
22
  export default PhoneInput;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,24 @@
1
- /// <reference types="react" />
2
- declare const PhoneInput: () => JSX.Element;
1
+ import React, { ReactNode } from 'react';
2
+
3
+ interface Props {
4
+ placeholder: string;
5
+ country: string;
6
+ onChange: (e: string) => void;
7
+ value?: string;
8
+ iconComponent?: ReactNode;
9
+ inputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
10
+ onlyCountries?: string[];
11
+ excludeCountries?: string[];
12
+ preferredCountries?: string[];
13
+ showDropdownIcon?: boolean;
14
+ dialCodeInputField?: boolean;
15
+ search?: boolean;
16
+ searchPlaceholder?: string;
17
+ showSearchIcon?: boolean;
18
+ searchIconComponent?: ReactNode;
19
+ searchProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
20
+ searchNotFound?: string;
21
+ }
22
+ declare const PhoneInput: ({ placeholder, country, onChange, value, iconComponent, inputProps, onlyCountries, excludeCountries, preferredCountries, showDropdownIcon, dialCodeInputField, search, searchPlaceholder, showSearchIcon, searchIconComponent, searchProps, searchNotFound }: Props) => JSX.Element;
3
23
 
4
24
  export { PhoneInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-phone-input",
3
- "version": "1.0.6-beta",
3
+ "version": "1.0.8-beta",
4
4
  "description": "A simple react phone input component with calling code dropdown🤷",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -31,9 +31,14 @@
31
31
  "@types/react": "^18.0.26",
32
32
  "postcss": "^8.4.20",
33
33
  "react": "^18.2.0",
34
+ "react-dom": "^18.2.0",
34
35
  "rollup-plugin-dts": "^5.0.0",
35
36
  "rollup-plugin-postcss": "^4.0.2",
36
37
  "tslib": "^2.4.1",
37
38
  "typescript": "^4.9.4"
39
+ },
40
+ "peerDependencies": {
41
+ "react": "^18.2.0",
42
+ "react-dom": "^18.2.0"
38
43
  }
39
44
  }